Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions core/src/components/modal/test/sheet/modal.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
import { expect } from '@playwright/test';
import { configs, test, dragElementBy } from '@utils/test/playwright';

configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('sheet modal: rendering'), () => {
test('should not have visual regressions', async ({ page }) => {
await page.goto('/src/components/modal/test/sheet', config);
const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent');
configs({ modes: ['ios', 'md', 'ionic-ios', 'ionic-md'], directions: ['ltr'] }).forEach(
({ title, screenshot, config }) => {
test.describe(title('sheet modal: rendering'), () => {
test('should not have visual regressions', async ({ page }) => {
await page.goto('/src/components/modal/test/sheet', config);
const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent');

await page.click('#sheet-modal');
await page.click('#sheet-modal');

await ionModalDidPresent.next();
await ionModalDidPresent.next();

await expect(page).toHaveScreenshot(screenshot(`modal-sheet-present`), {
/**
* Animations must be enabled to capture the screenshot.
* By default, animations are disabled with toHaveScreenshot,
* and when capturing the screenshot will call animation.finish().
* This will cause the modal to close and the screenshot capture
* to be invalid.
*/
animations: 'allow',
await expect(page).toHaveScreenshot(screenshot(`modal-sheet-present`), {
/**
* Animations must be enabled to capture the screenshot.
* By default, animations are disabled with toHaveScreenshot,
* and when capturing the screenshot will call animation.finish().
* This will cause the modal to close and the screenshot capture
* to be invalid.
*/
animations: 'allow',
});
});
});
});
});
}
);

configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
configs({ modes: ['ionic-ios', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('sheet modal: half screen rendering'), () => {
test('should not have visual regressions', async ({ page }) => {
await page.goto('/src/components/modal/test/sheet', config);
Expand Down Expand Up @@ -62,7 +64,7 @@ configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screensh
});
});

configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => {
configs({ modes: ['ios', 'ionic-ios'], directions: ['ltr'] }).forEach(({ title, config }) => {
test.describe(title('sheet modal: backdrop'), () => {
test.beforeEach(async ({ page }) => {
await page.goto('/src/components/modal/test/sheet', config);
Expand Down
46 changes: 34 additions & 12 deletions core/src/components/toolbar/test/basic/toolbar.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';

configs({ palettes: ['light', 'dark'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('toolbar: basic (LTR only)'), () => {
test('should not have visual regressions with text only', async ({ page }) => {
await page.setContent(
`
configs({ modes: ['ios', 'md', 'ionic-md'], palettes: ['light', 'dark'], directions: ['ltr'] }).forEach(
({ title, screenshot, config }) => {
test.describe(title('toolbar: basic (LTR only)'), () => {
test('should not have visual regressions with text only', async ({ page }) => {
await page.setContent(
`
<ion-header>
<ion-toolbar>
<ion-title>Toolbar</ion-title>
</ion-toolbar>
</ion-header>
`,
config
);
config
);

const header = page.locator('ion-header');
await expect(header).toHaveScreenshot(screenshot(`toolbar-basic-text-only`));
const header = page.locator('ion-header');
await expect(header).toHaveScreenshot(screenshot(`toolbar-basic-text-only`));
});
});
});
});
}
);

configs({ palettes: ['light', 'dark'] }).forEach(({ title, screenshot, config }) => {
configs({ modes: ['ios', 'md', 'ionic-md'], palettes: ['light', 'dark'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('toolbar: basic'), () => {
test('should truncate long title with ellipsis', async ({ page }) => {
await page.setContent(
Expand Down Expand Up @@ -156,5 +158,25 @@ configs({ palettes: ['light', 'dark'] }).forEach(({ title, screenshot, config })
const header = page.locator('ion-header');
await expect(header).toHaveScreenshot(screenshot(`toolbar-basic-text-icon-buttons`));
});

test('should not have visual regressions with text and button inside the content slot', async ({ page }) => {
await page.setContent(
`
<ion-header>
<ion-toolbar>
<ion-button fill="solid">
<ion-icon slot="start" name="person-circle"></ion-icon>
Solid
</ion-button>
<span>Solid</span>
</ion-toolbar>
</ion-header>
`,
config
);

const header = page.locator('ion-header');
await expect(header).toHaveScreenshot(screenshot(`toolbar-basic-text-buttons-inside-content`));
});
});
});
10 changes: 10 additions & 0 deletions core/src/components/toolbar/toolbar.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@

.toolbar-container {
gap: globals.$ion-space-400;
// TODO(ROU-10853): replace this value with a layer token
z-index: 10;
}

// Toolbar: Transparent
// --------------------------------------------------

.toolbar-background {
// TODO(ROU-10853): replace this value with a layer token
z-index: -1;
}

// Toolbar: Content
Expand Down
Loading