Skip to content

Commit

Permalink
Improve v-sync test. (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
furybean authored and QingWei-Li committed Oct 24, 2016
1 parent 984a3bf commit 07b0e79
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/unit/specs/sync.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const Test = {

describe('Sync', () => {
it('should not throw when use incorrectly', () => {
sinon.stub(window.console, 'warn');

createVue({
template: `
<test v-sync>
Expand All @@ -29,6 +31,8 @@ describe('Sync', () => {
}
});

expect(window.console.warn.callCount).to.equal(1);

createVue({
template: `
<test v-sync:visible>
Expand All @@ -43,6 +47,8 @@ describe('Sync', () => {
}
});

expect(window.console.warn.callCount).to.equal(2);

createVue({
template: `
<test v-sync.visible>
Expand All @@ -57,6 +63,8 @@ describe('Sync', () => {
}
});

expect(window.console.warn.callCount).to.equal(3);

createVue({
template: `
<div v-sync:visible="myVisible">
Expand All @@ -70,6 +78,10 @@ describe('Sync', () => {
};
}
});

expect(window.console.warn.callCount).to.equal(4);

window.console.warn.restore();
});

it('context variable should change when inner component variable change', (done) => {
Expand Down

0 comments on commit 07b0e79

Please sign in to comment.