From 4688dc77cebcb4e15616b39ebfb66047f03ed68d Mon Sep 17 00:00:00 2001 From: Jeremias Peier Date: Thu, 18 Jan 2024 13:33:18 +0100 Subject: [PATCH] test(sbb-timetable-occupancy): fix awaiting snapshots --- .../timetable-occupancy.spec.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/timetable-occupancy/timetable-occupancy.spec.ts b/src/components/timetable-occupancy/timetable-occupancy.spec.ts index 7fdb916fb1..feb61b940a 100644 --- a/src/components/timetable-occupancy/timetable-occupancy.spec.ts +++ b/src/components/timetable-occupancy/timetable-occupancy.spec.ts @@ -20,7 +20,7 @@ describe('sbb-timetable-occupancy', () => { 'second-class-occupancy': 'high', }), ); - expect(element).dom.to.be.equalSnapshot(); + await expect(element).dom.to.be.equalSnapshot(); }); it('renders - ShadowDOM', async () => { @@ -30,7 +30,7 @@ describe('sbb-timetable-occupancy', () => { 'second-class-occupancy': 'high', }), ); - expect(element).shadowDom.to.be.equalSnapshot(); + await expect(element).shadowDom.to.be.equalSnapshot(); }); it('renders negative - DOM', async () => { @@ -41,7 +41,7 @@ describe('sbb-timetable-occupancy', () => { negative: true, }), ); - expect(element).dom.to.be.equalSnapshot(); + await expect(element).dom.to.be.equalSnapshot(); }); it('renders negative - ShadowDOM', async () => { @@ -52,34 +52,34 @@ describe('sbb-timetable-occupancy', () => { negative: true, }), ); - expect(element).shadowDom.to.be.equalSnapshot(); + await expect(element).shadowDom.to.be.equalSnapshot(); }); it('renders only first class wagon - DOM', async () => { const element: SbbTimetableOccupancyElement = await fixture( renderComponent({ 'first-class-occupancy': 'low' }), ); - expect(element).dom.to.be.equalSnapshot(); + await expect(element).dom.to.be.equalSnapshot(); }); it('renders only first class wagon - ShadowDOM', async () => { const element: SbbTimetableOccupancyElement = await fixture( renderComponent({ 'first-class-occupancy': 'low' }), ); - expect(element).shadowDom.to.be.equalSnapshot(); + await expect(element).shadowDom.to.be.equalSnapshot(); }); it('renders only second class wagon - DOM', async () => { const element: SbbTimetableOccupancyElement = await fixture( renderComponent({ 'second-class-occupancy': 'none' }), ); - expect(element).dom.to.be.equalSnapshot(); + await expect(element).dom.to.be.equalSnapshot(); }); it('renders only second class wagon - ShadowDOM', async () => { const element: SbbTimetableOccupancyElement = await fixture( renderComponent({ 'second-class-occupancy': 'none' }), ); - expect(element).shadowDom.to.be.equalSnapshot(); + await expect(element).shadowDom.to.be.equalSnapshot(); }); });