-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
correctly bind one-way select value attributes (#423)
- Loading branch information
Showing
4 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
test/runtime/samples/select-one-way-bind-object/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const items = [ {}, {} ]; | ||
|
||
export default { | ||
skip: true, // JSDOM quirks | ||
|
||
'skip-ssr': true, | ||
|
||
data: { | ||
foo: items[0], | ||
items | ||
}, | ||
|
||
test ( assert, component, target ) { | ||
const options = target.querySelectorAll( 'option' ); | ||
|
||
assert.equal( options[0].selected, true ); | ||
assert.equal( options[1].selected, false ); | ||
|
||
component.set( { foo: items[1] } ); | ||
|
||
assert.equal( options[0].selected, false ); | ||
assert.equal( options[1].selected, true ); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<select value="{{foo}}"> | ||
<option value='{{items[0]}}'>a</option> | ||
<option value='{{items[1]}}'>b</option> | ||
</select> |