Skip to content

Commit 357ec88

Browse files
committed
Add awaits to tests to make sure components are updated
1 parent 74723d4 commit 357ec88

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tests/unit/specs/components/ChooserStep.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ describe('ChooserStep.vue', () => {
1919
})
2020

2121
// It's only for one state, but this should be enough to test if the logic works properly
22-
it('Check that all computed i18n props return correct values', () => {
23-
wrapper.setProps({
22+
it('Check that all computed i18n props return correct values', async () => {
23+
await wrapper.setProps({
2424
disabledDue: '',
2525
enabled: true,
2626
reversed: false,
@@ -37,8 +37,8 @@ describe('ChooserStep.vue', () => {
3737
expect(wrapper.vm.yesText).toBe('stepper.BY.selected')
3838
})
3939

40-
it('Check that all computed i18n props return correct values after true selected', () => {
41-
wrapper.setProps({
40+
it('Check that all computed i18n props return correct values after true selected', async () => {
41+
await wrapper.setProps({
4242
disabledDue: undefined,
4343
enabled: true,
4444
reversed: false,
@@ -56,8 +56,8 @@ describe('ChooserStep.vue', () => {
5656
expect(wrapper.vm.yesText).toBe('stepper.BY.selected')
5757
})
5858

59-
it('Check that all computed i18n props return correct values after false selected', () => {
60-
wrapper.setProps({
59+
it('Check that all computed i18n props return correct values after false selected', async () => {
60+
await wrapper.setProps({
6161
disabledDue: undefined,
6262
enabled: true,
6363
reversed: false,
@@ -85,8 +85,8 @@ describe('ChooserStep.vue', () => {
8585
expect(wrapper.vm.radio).toBe('no')
8686
})
8787

88-
it('props:selected true', () => {
89-
wrapper.setProps({
88+
it('props:selected true', async () => {
89+
await wrapper.setProps({
9090
selected: true,
9191
name: 'FS',
9292
id: 0,

tests/unit/specs/components/Stepper.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ describe('Stepper.vue', () => {
8585
expect(steps.at(0).classes('completed')).toBe(true)
8686
expect(wrapper.find('.active').classes('DD')).toBe(true)
8787
})
88-
it('choosing No sets 6 steps visible: FS, BY, NC, ND, SA and AttributionDetails, opens BY', () => {
88+
it('choosing No sets 6 steps visible: FS, BY, NC, ND, SA and AttributionDetails, opens BY', async () => {
8989
setStepSelected(wrapper, 'FS', false)
9090
wrapper.find('stepnavigation-stub').vm.$emit('navigate', { direction: 'next', name: 'FS' })
91-
Vue.nextTick()
91+
await Vue.nextTick()
9292
const steps = wrapper.findAll('.step-container')
9393
expect(steps.length).toEqual(6)
9494
expect(wrapper.vm.activeStepId).toEqual(1)

0 commit comments

Comments
 (0)