Skip to content

Commit

Permalink
add test for select option issue (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
cayasso committed Feb 24, 2017
1 parent 1d4264c commit 9e5ac94
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/generator/select/_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
export default {
data: {
item: {
name: 'One',
key: 'a'
}
},

html: `
<select>
<option value="a">One</option>
<option value="b">Two</option>
<option value="c">Three</option>
</select>
`,

test ( assert, component, target ) {
component.set({ item:
{
name: 'One',
key: 'a'
}
})

assert.htmlEqual( target.innerHTML,`
<select>
<option value="a">One</option>
<option value="b">Two</option>
<option value="c">Three</option>
</select>
`);

component.teardown();
assert.htmlEqual( target.innerHTML, '' );
}
};
5 changes: 5 additions & 0 deletions test/generator/select/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<select>
<option value="{{item.key}}">{{item.name}}</option>
<option value="b">Two</option>
<option value="c">Three</option>
</select>

0 comments on commit 9e5ac94

Please sign in to comment.