-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for {{ inline }} expressions
- Loading branch information
1 parent
2406bdc
commit 4f2a8d4
Showing
4 changed files
with
45 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
await self.yozo.register('./bo-independence.yz'); | ||
const element = document.createElement('greeter-independence'); | ||
|
||
element.greeting = 'hello'; | ||
element.receiver = 'world'; | ||
document.body.append(element); | ||
await 'microtask'; | ||
assert(element.textContent.trim() == 'hello, world!'); | ||
|
||
element.greeting = 'hi'; | ||
element.receiver = 'earth'; | ||
await 'microtask'; | ||
assert(element.textContent.trim() == 'hello, earth!'); |
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,7 @@ | ||
<title>greeter-independence</title> | ||
<meta attribute="greeting" type="string"> | ||
<meta attribute="receiver" type="string"> | ||
|
||
<template> | ||
{{ self.yozo.monitor.ignore(() => $.greeting) }}, {{ $.receiver }}! | ||
</template> |
18 changes: 18 additions & 0 deletions
18
test/components/template/inline/bo-not-when-disconnected.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,18 @@ | ||
await self.yozo.register('./bo-not-when-disconnected.yz'); | ||
const element = document.createElement('greeter-not-when-disconnected'); | ||
|
||
element.greeting = 'hello'; | ||
element.receiver = 'world'; | ||
document.body.append(element); | ||
await 'microtask'; | ||
assert(element.textContent.trim() == 'hello, world!'); | ||
|
||
element.remove(); | ||
element.greeting = 'hi'; | ||
element.receiver = 'earth'; | ||
await 'microtask'; | ||
assert(element.textContent.trim() == 'hello, world!'); | ||
|
||
document.body.append(element); | ||
await 'microtask'; | ||
assert(element.textContent.trim() == 'hi, earth!'); |
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,7 @@ | ||
<title>greeter-not-when-disconnected</title> | ||
<meta attribute="greeting" type="string"> | ||
<meta attribute="receiver" type="string"> | ||
|
||
<template> | ||
{{ $.greeting }}, {{ $.receiver }}! | ||
</template> |