dna.js Semantic Templates

Test Cases

dna.jsswitch

Test Case: #01

Add 3 items and delete 1 item

Actual
Title: ~~title~~
Author: ~~author~~
Expected
Title: The DOM
Author: Jan
Title: Howdy HTML5
Author: Ed

Test Case: #02

Add 2 items, empty, and add 1 item (with mustache)

Actual

Title: {{title}}
Author: {{author}}

Expected

Title: The One
Author: Lee

Test Case: #03

Add 3 items with fade (1st one blue) and top set to true

Actual

Title: ~~title~~
Author: ~~author~~

Expected

Title: 3rd
Author: Jan
Title: 2nd
Author: Jan
Title: 1st
Author: Jan

Test Case: #04

Add 1 items with an image

Actual
Title: ~~title~~
Author: ~~author~~
Cover: Cover
Expected
Title: <b>Text</b>&bull;
Author: Lee
Cover: Cover

Test Case: #05

Add 2 items in an array twice

Actual
Expected
Title: 1st
Author: Lee
Code: 11
Title: 2st
Author: Jan
Code: 9
Title: 1st
Author: Lee
Code: 11
Title: 2st
Author: Jan
Code: 9

Test Case: #06

Add 1 item with attributes

Actual
Title: ~~title~~
Expected
Title: Les Attributs

Test Case: #07

Embedded template with array of data

Actual
Author: ~~author.name~~
Chapter: ~~header~~~~author.name~~
Expected
Author: Ed
Author: Jan
Chapter: Preface
Chapter: Index
Author: Lee

Test Case: #08

Add 2 items and refresh

Actual

Authors (1): ~~[value]~~

Authors (2): ~~[value]~~

Authors (3): ~~[value]~~

Title: ~~title~~
Authors: *~~[value]~~
Score: ~~score~~
On Sale: ~~sale~~
Expected

Authors (1): Jan

Authors (2): Jan and Bo

Authors (3): Jan, Bo and Ed

Title: The New DOM
Authors: *Jan II *Bo
Score: 81
On Sale: true
Title: Howdy HTML5
Authors: *Ed II
Score: 97
On Sale: false

Test Case: #09

Add 2 items ( and ) loaded from REST call

Actual
Title: ~~title~~
Author: ~~author~~
Expected
Title: Go JavaScript
Author: Jake
Title: Styling CSS3
Author: Abby

Test Case: #10

Add 1 item and apply callback function

Actual
~~title~~
Expected
Background

Test Case: #11

Add 2 items with missing fields

Actual
Title: ~~title~~ [Gone with the Wind]
Author: ~~author~~
[no author]
Available
Out of stock
ON SALE!
Regular price
Expected
Title: [Gone with the Wind]
Author: Jan
Available
ON SALE!
Title: Howdy HTML5
[no author]
Out of stock
Regular price

Test Case: #12

Array field (sub-template)

Actual
Title: ~~title~~
Authors: (~~[count]~~) ~~[value]~~
~~type~~: ~~header~~
Expected
Title: The DOM
Authors: (1) Bo I (2) Bo II
Title: Howdy HTML5
Authors: (1) Ed (2) Jake (3) Abby
front: Preface &star;
back: Index
Title: Styling CSS3
Authors:
Title: Howdy HTML5
Authors: (1) Ed (2) Jake (3) Abby
front: Preface ☆
back: Index
back: Bio
back: Bio 3

Test Case: #13

Security

Actual
Title: ~~[value]~~
Expected
Title: <script>alert(1);</script>
Title: <script>alert(2);</script>
Title: 3

Test Case: #14

Simple array with rearrange and delete

Actual
Book #~~[count]~~: ~~[value]~~
Placeholder
Expected
Book #1: The DOM
Book #2: Howdy HTML5
Book #3: Styling CSS3
Placeholder

Test Case: #15

Events

Actual

~~[count]~~: ~~[value]~~
No more clones!
Expected



3: Howdy HTML5
5: Styling CSS3










Test Case: #16

Input tag properties (minimized attributes)

Actual

Title:

Options:
Cover:
Purpose:
~~category~~
Tags:

~~code~~

Secret:

~~secret~~

Published:

Cover Color:

Note:


~~note~~

Check js console for smart updates
Expected

Title:

Options:
Cover:
Purpose:
computers
Tags:

tech color

Secret:

Signed!

Published:

Cover Color:

Note:


Award winning

Check js console for smart updates

Test Case: #17

Reusable component

Actual

Bookshelf

Title: ~~title~~
Author: ~~author~~
Expected

Bookshelf

Title: Go JavaScript
Author: Jake
Title: Styling CSS
Author: Abby
Title: Howdy HTML5
Author: Ed

Test Case: #18

Panels

Actual
  1. ~~title~~

~~title~~

~~author~~

~~displayPrice~~

On SALE


Categories

HTML!

CSS!

W3C!

Protocals!

Equipment!

Expected
  1. The DOM
  2. Styling CSS3
  3. Howdy HTML5

Styling CSS3

Abby

$19.99

On SALE


Categories

W3C!