From 3686a93878532efb6ae4503d545216c09a56a48e Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Thu, 16 Jan 2020 13:11:49 +0100 Subject: [PATCH] Add nextTick to CreateUserAccount - there were changes that moved vue-test-utils from synchronous to asynchronous, which means we need to use nextTick before checking certain attributes. --- webapp/components/Registration/CreateUserAccount.spec.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/components/Registration/CreateUserAccount.spec.js b/webapp/components/Registration/CreateUserAccount.spec.js index 8d1f1617d..faa9319e7 100644 --- a/webapp/components/Registration/CreateUserAccount.spec.js +++ b/webapp/components/Registration/CreateUserAccount.spec.js @@ -1,8 +1,8 @@ import { config, mount } from '@vue/test-utils' +import Vue from 'vue' import { VERSION } from '~/constants/terms-and-conditions-version.js' import CreateUserAccount from './CreateUserAccount' import { SignupVerificationMutation } from '~/graphql/Registration.js' - const localVue = global.localVue config.stubs['sweetalert-icon'] = '' @@ -110,6 +110,7 @@ describe('CreateUserAccount', () => { it('displays success', async () => { await action() + await Vue.nextTick() expect(mocks.$t).toHaveBeenCalledWith( 'components.registration.create-user-account.success', ) @@ -140,6 +141,7 @@ describe('CreateUserAccount', () => { it('displays form errors', async () => { await action() + await Vue.nextTick() expect(mocks.$t).toHaveBeenCalledWith( 'components.registration.create-user-account.error', )