forked from sveltejs/svelte
-
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 test case for sveltejsgh-714 situation.
- Loading branch information
Yury Zhuravlev
committed
Jul 21, 2017
1 parent
177e4f8
commit 05a270a
Showing
4 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
test/runtime/samples/bindings-before-oncreate-change-dom/One.html
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,20 @@ | ||
<Two bind:foo/> | ||
<p class="{{test ? 't1' : 't2'}}"></p> | ||
|
||
<script> | ||
import Two from './Two.html'; | ||
|
||
export default { | ||
data() { | ||
return { | ||
test: false | ||
}; | ||
}, | ||
components: { | ||
Two | ||
}, | ||
oncreate() { | ||
this.snapshot = this.get('foo'); | ||
} | ||
}; | ||
</script> |
15 changes: 15 additions & 0 deletions
15
test/runtime/samples/bindings-before-oncreate-change-dom/Two.html
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,15 @@ | ||
<script> | ||
export default { | ||
data() { | ||
return { | ||
bar: 1 | ||
}; | ||
}, | ||
|
||
computed: { | ||
foo(bar) { | ||
return bar * 2; | ||
} | ||
} | ||
}; | ||
</script> |
5 changes: 5 additions & 0 deletions
5
test/runtime/samples/bindings-before-oncreate-change-dom/_config.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,5 @@ | ||
export default { | ||
test(assert, component) { | ||
assert.equal(component.refs.one.snapshot, 2); | ||
} | ||
}; |
9 changes: 9 additions & 0 deletions
9
test/runtime/samples/bindings-before-oncreate-change-dom/main.html
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,9 @@ | ||
<One ref:one/> | ||
|
||
<script> | ||
import One from './One.html'; | ||
|
||
export default { | ||
components: { One } | ||
}; | ||
</script> |