Skip to content

Commit

Permalink
added segment test and snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
BenOsodrac committed Dec 10, 2024
1 parent 9db9287 commit b1a9712
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions core/src/components/segment/test/states/segment.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';

configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('segment: states'), () => {
test('should render focused segment correctly', async ({ page }) => {
await page.setContent(
`
<ion-segment value="2">
<ion-segment-button value="1">
<ion-label>Bookmarks</ion-label>
</ion-segment-button>
<ion-segment-button class="ion-focused" value="2">
<ion-label>Reading List</ion-label>
</ion-segment-button>
<ion-segment-button value="3">
<ion-label>Shared Links</ion-label>
</ion-segment-button>
</ion-segment>
`,
config
);

const segment = page.locator('ion-segment');

await expect(segment).toHaveScreenshot(screenshot(`segment-focused`));
});
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b1a9712

Please sign in to comment.