-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9432d1
commit 52a30dc
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
test/runtime/samples/binding-input-text-deconflicted/_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,36 @@ | ||
export default { | ||
solo: true, | ||
|
||
data: { | ||
component: { | ||
name: 'world' | ||
} | ||
}, | ||
|
||
html: ` | ||
<h1>Hello world!</h1> | ||
<input> | ||
`, | ||
|
||
test ( assert, component, target, window ) { | ||
const input = target.querySelector( 'input' ); | ||
assert.equal( input.value, 'world' ); | ||
|
||
const event = new window.Event( 'input' ); | ||
|
||
input.value = 'everybody'; | ||
input.dispatchEvent( event ); | ||
|
||
assert.equal( target.innerHTML, ` | ||
<h1>Hello everybody!</h1> | ||
<input> | ||
` ); | ||
|
||
component.set({ name: 'goodbye' }); | ||
assert.equal( input.value, 'goodbye' ); | ||
assert.equal( target.innerHTML, ` | ||
<h1>Hello goodbye!</h1> | ||
<input> | ||
` ); | ||
} | ||
}; |
2 changes: 2 additions & 0 deletions
2
test/runtime/samples/binding-input-text-deconflicted/main.html
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,2 @@ | ||
<h1>Hello {{component.name}}!</h1> | ||
<input bind:value="component.name"/> |