Skip to content

Commit

Permalink
test(sbb-timetable-occupancy): fix awaiting snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB committed Jan 18, 2024
1 parent e0863c5 commit 4688dc7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/timetable-occupancy/timetable-occupancy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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 () => {
Expand All @@ -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 () => {
Expand All @@ -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();
});
});

0 comments on commit 4688dc7

Please sign in to comment.