Skip to content

Commit

Permalink
Add test case for sveltejsgh-714 situation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yury Zhuravlev committed Jul 21, 2017
1 parent 177e4f8 commit 05a270a
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/runtime/samples/bindings-before-oncreate-change-dom/One.html
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 test/runtime/samples/bindings-before-oncreate-change-dom/Two.html
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>
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);
}
};
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>

0 comments on commit 05a270a

Please sign in to comment.