Skip to content

Commit a6836bd

Browse files
committed
Failing test for #975
1 parent aeabf1c commit a6836bd

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
let fulfil;
2+
3+
let thePromise = new Promise(f => {
4+
fulfil = f;
5+
});
6+
7+
export default {
8+
data: {
9+
show: true,
10+
thePromise
11+
},
12+
13+
html: `
14+
<p>loading...</p>
15+
`,
16+
17+
test(assert, component, target) {
18+
fulfil(42);
19+
20+
return thePromise
21+
.then(() => {
22+
assert.htmlEqual(target.innerHTML, `
23+
<p>the value is 42</p>
24+
`);
25+
26+
component.set({
27+
show: false
28+
});
29+
30+
assert.htmlEqual(target.innerHTML, `
31+
<p>Else</p>
32+
`);
33+
34+
component.set({
35+
show: true
36+
});
37+
38+
assert.htmlEqual(target.innerHTML, `
39+
<p>the value is 42</p>
40+
`);
41+
});
42+
}
43+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{#if show}}
2+
{{#await thePromise}}
3+
<p>loading...</p>
4+
{{then theValue}}
5+
<p>the value is {{theValue}}</p>
6+
{{catch theError}}
7+
<p>oh no! {{theError.message}}</p>
8+
{{/await}}
9+
{{else}}
10+
<p>Else</p>
11+
{{/if}}

0 commit comments

Comments
 (0)