Skip to content

Commit 6437d7b

Browse files
committed
failing test for #1417
1 parent 8138627 commit 6437d7b

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
let fulfil;
2+
3+
let promise = new Promise(f => {
4+
fulfil = f;
5+
});
6+
7+
export default {
8+
solo: 1,
9+
data: {
10+
promise
11+
},
12+
13+
html: `
14+
<p>loading...</p>
15+
`,
16+
17+
test(assert, component, target) {
18+
fulfil(42);
19+
20+
return promise
21+
.then(() => {
22+
assert.htmlEqual(target.innerHTML, `
23+
<p>loaded</p>
24+
`);
25+
26+
promise = new Promise((f, r) => {
27+
fulfil = f;
28+
});
29+
30+
component.set({
31+
promise
32+
});
33+
34+
assert.htmlEqual(target.innerHTML, `
35+
<p>loading...</p>
36+
`);
37+
38+
fulfil(43);
39+
40+
return promise.then(() => {});
41+
})
42+
.then(() => {
43+
assert.htmlEqual(target.innerHTML, `
44+
<p>loaded</p>
45+
`);
46+
});
47+
}
48+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{#await promise}
2+
<p>loading...</p>
3+
{:then value}
4+
<p>loaded</p>
5+
{:catch error}
6+
<p>errored</p>
7+
{/await}

0 commit comments

Comments
 (0)