mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
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.
This commit is contained in:
parent
8c29ad947b
commit
3686a93878
@ -1,8 +1,8 @@
|
|||||||
import { config, mount } from '@vue/test-utils'
|
import { config, mount } from '@vue/test-utils'
|
||||||
|
import Vue from 'vue'
|
||||||
import { VERSION } from '~/constants/terms-and-conditions-version.js'
|
import { VERSION } from '~/constants/terms-and-conditions-version.js'
|
||||||
import CreateUserAccount from './CreateUserAccount'
|
import CreateUserAccount from './CreateUserAccount'
|
||||||
import { SignupVerificationMutation } from '~/graphql/Registration.js'
|
import { SignupVerificationMutation } from '~/graphql/Registration.js'
|
||||||
|
|
||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
|
||||||
config.stubs['sweetalert-icon'] = '<span><slot /></span>'
|
config.stubs['sweetalert-icon'] = '<span><slot /></span>'
|
||||||
@ -110,6 +110,7 @@ describe('CreateUserAccount', () => {
|
|||||||
|
|
||||||
it('displays success', async () => {
|
it('displays success', async () => {
|
||||||
await action()
|
await action()
|
||||||
|
await Vue.nextTick()
|
||||||
expect(mocks.$t).toHaveBeenCalledWith(
|
expect(mocks.$t).toHaveBeenCalledWith(
|
||||||
'components.registration.create-user-account.success',
|
'components.registration.create-user-account.success',
|
||||||
)
|
)
|
||||||
@ -140,6 +141,7 @@ describe('CreateUserAccount', () => {
|
|||||||
|
|
||||||
it('displays form errors', async () => {
|
it('displays form errors', async () => {
|
||||||
await action()
|
await action()
|
||||||
|
await Vue.nextTick()
|
||||||
expect(mocks.$t).toHaveBeenCalledWith(
|
expect(mocks.$t).toHaveBeenCalledWith(
|
||||||
'components.registration.create-user-account.error',
|
'components.registration.create-user-account.error',
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user