Skip to content

Commit

Permalink
fix(tests): add async/await for setProps rendering
Browse files Browse the repository at this point in the history
cf vuejs/vue-test-utils#1752 that was added sneakily to 1.1.3
  • Loading branch information
alexandrecoin committed Feb 23, 2021
1 parent ed39b86 commit 17110df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/components/PixImage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Component: PixImage', () => {
})

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

// When
component.setProps({ field: imageWithAlt })
await component.setProps({ field: imageWithAlt })

// Then
expect(component.vm.image).toEqual(imageWithAlt)
})

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

// When
component.setProps({ field: imageWithoutAlt })
await component.setProps({ field: imageWithoutAlt })

// Then
expect(component.vm.image).toEqual(expectedImage)
Expand Down

0 comments on commit 17110df

Please sign in to comment.