|
@@ -66,6 +66,8 @@ test('it works with x-model',
|
|
|
|
|
|
<article x-text="selected?.name"></article>
|
|
<article x-text="selected?.name"></article>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <a href="#" x-on:click.prevent="selected = { id: 7, name: 'Caroline Schultz' }">Set selected via code</a>
|
|
</div>
|
|
</div>
|
|
`],
|
|
`],
|
|
({ get }) => {
|
|
({ get }) => {
|
|
@@ -95,6 +97,9 @@ test('it works with x-model',
|
|
get('ul').should(notBeVisible())
|
|
get('ul').should(notBeVisible())
|
|
get('input').should(haveValue('Wade Cooper'))
|
|
get('input').should(haveValue('Wade Cooper'))
|
|
get('article').should(haveText('Wade Cooper'))
|
|
get('article').should(haveText('Wade Cooper'))
|
|
|
|
+ get('a').click()
|
|
|
|
+ get('input').should(haveValue('Caroline Schultz'))
|
|
|
|
+ get('article').should(haveText('Caroline Schultz'))
|
|
},
|
|
},
|
|
)
|
|
)
|
|
|
|
|
|
@@ -1271,6 +1276,7 @@ test('input reset',
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<article>lorem ipsum</article>
|
|
<article>lorem ipsum</article>
|
|
|
|
+ <a x-on:click="selected = null">Clear</a>
|
|
</div>
|
|
</div>
|
|
`],
|
|
`],
|
|
({ get }) => {
|
|
({ get }) => {
|
|
@@ -1327,6 +1333,10 @@ test('input reset',
|
|
get('input').type('w')
|
|
get('input').type('w')
|
|
get('article').click()
|
|
get('article').click()
|
|
get('input').should(haveValue('Arlene Mccoy'))
|
|
get('input').should(haveValue('Arlene Mccoy'))
|
|
|
|
+
|
|
|
|
+ // Test correct state after clearing selected via code
|
|
|
|
+ get('a').click()
|
|
|
|
+ get('input').should(haveValue(''))
|
|
},
|
|
},
|
|
)
|
|
)
|
|
|
|
|