Skip to content

Commit 31123cb

Browse files
committed
Fix failing UI test
1 parent b477ee2 commit 31123cb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ui/tests/unit/views/compute/MigrateWizard.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ mocks = {
8080
}
8181
break
8282
}
83-
})
83+
}),
84+
$notifyError: jest.fn()
8485
}
8586

8687
const factory = (opts = {}) => {
@@ -295,17 +296,16 @@ describe('Views > compute > MigrateWizard.vue', () => {
295296
done()
296297
})
297298

298-
it('check $message.error should be called when api is called with throw error', async (done) => {
299+
it('check $notifyError should be called when api is called with throw error', async (done) => {
299300
const mockError = 'Error: throw error message'
300301

301302
await mockAxios.mockRejectedValue(mockError)
302303
await wrapper.setProps({ resource: {} })
303304
await wrapper.vm.fetchData()
304305
await flushPromises()
305-
await flushPromises()
306306

307-
expect(mocks.$message.error).toHaveBeenCalled()
308-
expect(mocks.$message.error).toHaveBeenLastCalledWith(`${i18n.global.t('message.load.host.failed')}: ${mockError}`)
307+
expect(mocks.$notifyError).toHaveBeenCalled()
308+
expect(mocks.$notifyError).toHaveBeenLastCalledWith(mockError)
309309
done()
310310
})
311311
})

0 commit comments

Comments
 (0)