Closed
Description
Subject of the issue
The last version 1.0.5 use wrapper.vm change the data, but the wrapper element text was old text
Steps to reproduce
the test.vue
`
{{ count }}
Increment
<script>
export default {
data () {
return {
count: 0,
testValue: true
};
},
{{testValue ? 'a': 'b'}}
methods: {
increment () {
this.count++;
}
}
};
</script>`
the test unit
`import { shallowMount } from '@vue/test-utils';
import Test from '@/components/test';
describe('Test Components', () => {
let wrapper;
// 每个it开始之前执行
beforeEach(() => {
// 初始化wrapper
wrapper = shallowMount(Test);
});
// 每个it结束时执行
afterEach(() => {
// 销毁wrapper
wrapper.destroy();
});
it('show and hide', () => {
const text = wrapper.find('.testText');
expect(text.text()).toBe('a');
wrapper.vm.testValue = false;
expect(text.text()).toBe('b');
});
});`
Expected behaviour
use @vue/test-utils 1.0.5
Actual behaviour
the unit test is failed
Possible Solution
use 1.0.0-beta.29 is passed
Metadata
Metadata
Assignees
Labels
No labels