Closed
Description
Version
1.0.0-beta.25
Reproduction link
https://github.com/Aaron-Pool/vue-test-utils-jest-example
Steps to reproduce
- clone reproduction repo
Run yarn
- run
yarn jest
What is expected?
Test should pass, because reactive data changed in the mount component, so the scoped slot function should have been called again on re-render.
What is actually happening?
No re-render occurs, even though the data updates as expected.
I assume this has something to do with async vs. sync paradigm that is happening in the test-utils.
It works correctly if I run the test like so:
it('should initialize with dimension data', done => {
const mockSlot = jest.fn();
const comp = factory(mockSlot);
comp.vm.$nextTick(() => {
expect(mockSlot.mock.calls).toEqual([[{ width: null, height: null }], [{ width: 500, height: 500 }]]);
done();
})
});