Skip to content

Commit 50d0229

Browse files
alexandrecoinStephane Bedeau
authored andcommitted
fix(tests): add async/await for setProps rendering
cf vuejs/vue-test-utils#1752 that was added sneakily to 1.1.3
1 parent 5957f1b commit 50d0229

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/components/PixImage.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('Component: PixImage', () => {
1212
})
1313

1414
describe('Computed Property : Image', () => {
15-
it('should return the same image object if there is an alt', () => {
15+
it('should return the same image object if there is an alt', async () => {
1616
// Given
1717
const imageWithAlt = {
1818
alt: 'Alternative Message',
@@ -25,13 +25,13 @@ describe('Component: PixImage', () => {
2525
}
2626

2727
// When
28-
component.setProps({ field: imageWithAlt })
28+
await component.setProps({ field: imageWithAlt })
2929

3030
// Then
3131
expect(component.vm.image).toEqual(imageWithAlt)
3232
})
3333

34-
it('should return the image object with empty alt and role when there is not alt', () => {
34+
it('should return the image object with empty alt and role when there is not alt', async () => {
3535
// Given
3636
const imageWithoutAlt = {
3737
alt: null,
@@ -47,7 +47,7 @@ describe('Component: PixImage', () => {
4747
expectedImage.role = 'presentation'
4848

4949
// When
50-
component.setProps({ field: imageWithoutAlt })
50+
await component.setProps({ field: imageWithoutAlt })
5151

5252
// Then
5353
expect(component.vm.image).toEqual(expectedImage)

0 commit comments

Comments
 (0)