fix tests
This commit is contained in:
parent
0cbdf6b8a1
commit
ec2853f2b6
@ -9,11 +9,13 @@ describe('FsExample.vue', () => {
|
||||
.toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('Click button', () => {
|
||||
test('Click button', async () => {
|
||||
const wrapper = shallowMount(FsExample);
|
||||
let domButton = wrapper.find('[data-test="fs-example-button"]');
|
||||
domButton.trigger('click');
|
||||
|
||||
await wrapper.vm.$nextTick();
|
||||
|
||||
expect(window.nw.require)
|
||||
.toHaveBeenCalledWith('fs');
|
||||
|
||||
@ -21,7 +23,7 @@ describe('FsExample.vue', () => {
|
||||
.toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('Error state', () => {
|
||||
test('Error state', async () => {
|
||||
window.nw.require.mockImplementation((module) => {
|
||||
if (module === 'fs') {
|
||||
return new Error();
|
||||
@ -32,6 +34,8 @@ describe('FsExample.vue', () => {
|
||||
let domButton = wrapper.find('[data-test="fs-example-button"]');
|
||||
domButton.trigger('click');
|
||||
|
||||
await wrapper.vm.$nextTick();
|
||||
|
||||
expect(window.nw.require)
|
||||
.toHaveBeenCalledWith('fs');
|
||||
|
||||
|
@ -19,19 +19,19 @@ describe('HelloWorld.vue', () => {
|
||||
.toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('Activate dev tools', () => {
|
||||
test('Activate dev tools', async () => {
|
||||
const wrapper = shallowMount(HelloWorld);
|
||||
|
||||
const button = wrapper.find('[data-test="toggleDevTools"]');
|
||||
|
||||
button.trigger('click');
|
||||
wrapper.vm.$nextTick();
|
||||
await wrapper.vm.$nextTick();
|
||||
|
||||
expect(wrapper.find('[data-test="toggleDevTools').html())
|
||||
.toMatchSnapshot('hide');
|
||||
|
||||
button.trigger('click');
|
||||
wrapper.vm.$nextTick();
|
||||
await wrapper.vm.$nextTick();
|
||||
|
||||
expect(wrapper.find('[data-test="toggleDevTools').html())
|
||||
.toMatchSnapshot('show');
|
||||
|
Loading…
Reference in New Issue
Block a user