|
@@ -52,7 +52,7 @@ test('x-if initializes after being added to the DOM to allow x-ref to work',
|
|
|
}
|
|
|
)
|
|
|
|
|
|
-//If x-if evaluates to false, the expectation is that no sub-expressions will be evaluated.
|
|
|
+// If x-if evaluates to false, the expectation is that no sub-expressions will be evaluated.
|
|
|
test('x-if removed dom does not evaluate reactive expressions in dom tree',
|
|
|
html`
|
|
|
<div x-data="{user: {name: 'lebowski'}}">
|
|
@@ -66,10 +66,9 @@ test('x-if removed dom does not evaluate reactive expressions in dom tree',
|
|
|
({ get }) => {
|
|
|
get('span').should(haveText('lebowski'))
|
|
|
|
|
|
- /** Clicking button sets user=null and thus x-if="user" will evaluate to false.
|
|
|
- If the sub-expression x-text="user.name" is evaluated, the button click
|
|
|
- will produce an error because user is no longer defined and the test will fail
|
|
|
- **/
|
|
|
+ // Clicking button sets user=null and thus x-if="user" will evaluate to false.
|
|
|
+ // If the sub-expression x-text="user.name" is evaluated, the button click
|
|
|
+ // will produce an error because user is no longer defined and the test will fail
|
|
|
get('button').click()
|
|
|
get('span').should('not.exist')
|
|
|
}
|