Commit 07b0e792 authored by FuryBean's avatar FuryBean Committed by cinwell.li

Improve v-sync test. (#603)

parent 984a3bf9
...@@ -15,6 +15,8 @@ const Test = { ...@@ -15,6 +15,8 @@ const Test = {
describe('Sync', () => { describe('Sync', () => {
it('should not throw when use incorrectly', () => { it('should not throw when use incorrectly', () => {
sinon.stub(window.console, 'warn');
createVue({ createVue({
template: ` template: `
<test v-sync> <test v-sync>
...@@ -29,6 +31,8 @@ describe('Sync', () => { ...@@ -29,6 +31,8 @@ describe('Sync', () => {
} }
}); });
expect(window.console.warn.callCount).to.equal(1);
createVue({ createVue({
template: ` template: `
<test v-sync:visible> <test v-sync:visible>
...@@ -43,6 +47,8 @@ describe('Sync', () => { ...@@ -43,6 +47,8 @@ describe('Sync', () => {
} }
}); });
expect(window.console.warn.callCount).to.equal(2);
createVue({ createVue({
template: ` template: `
<test v-sync.visible> <test v-sync.visible>
...@@ -57,6 +63,8 @@ describe('Sync', () => { ...@@ -57,6 +63,8 @@ describe('Sync', () => {
} }
}); });
expect(window.console.warn.callCount).to.equal(3);
createVue({ createVue({
template: ` template: `
<div v-sync:visible="myVisible"> <div v-sync:visible="myVisible">
...@@ -70,6 +78,10 @@ describe('Sync', () => { ...@@ -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) => { it('context variable should change when inner component variable change', (done) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment