Last active
June 1, 2019 19:46
-
-
Save visualjerk/337b011fa3edc0582d3f09efce8435f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { mount, config } from '@vue/test-utils' | |
import MyTransition from './my-transition.vue' | |
// Use default vue transition comp | |
config.stubs.transition = false | |
describe('MyTransition.vue', () => { | |
it('cleans styles after enter transition', () => { | |
const comp = { | |
template: `<div><my-transition><p v-show="show">foo</p></my-transition></div>`, | |
components: { | |
MyTransition | |
}, | |
data() { | |
return { | |
show: false | |
} | |
} | |
} | |
const wrapper = mount(comp) | |
// This triggers asynchronous behaviour inside the comp | |
wrapper.vm.show = true | |
const foo = wrapper.find('p') | |
expect(foo.element.style.cssText).toEqual('') // This will fail | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment