-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
161 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+560 Bytes
(110%)
...bar.e2e.ts-snapshots/tab-bar-default-ionic-md-ltr-light-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+540 Bytes
(110%)
...ar.e2e.ts-snapshots/tab-bar-default-ionic-md-ltr-light-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+658 Bytes
(110%)
...bar.e2e.ts-snapshots/tab-bar-default-ionic-md-ltr-light-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+584 Bytes
(110%)
...bar.e2e.ts-snapshots/tab-bar-default-ionic-md-rtl-light-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+590 Bytes
(110%)
...ar.e2e.ts-snapshots/tab-bar-default-ionic-md-rtl-light-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+666 Bytes
(110%)
...bar.e2e.ts-snapshots/tab-bar-default-ionic-md-rtl-light-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" dir="ltr"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Tab Button - Shape</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" /> | ||
<link rel="stylesheet" href="../../../../../css/ionic.bundle.css" /> | ||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet" /> | ||
<script src="../../../../../scripts/testing/scripts.js"></script> | ||
<script nomodule src="../../../../../dist/ionic/ionic.js"></script> | ||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script> | ||
</head> | ||
|
||
<body> | ||
<ion-app> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Tab Button - Shape</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content> | ||
<ion-text> (Only available for ionic theme) </ion-text> | ||
|
||
<ion-tab-bar> | ||
<ion-tab-button> | ||
<ion-label>Default Shape</ion-label> | ||
<ion-icon aria-hidden="true" name="triangle-outline"></ion-icon> | ||
</ion-tab-button> | ||
|
||
<ion-tab-button id="soft-tab-button" shape="soft"> | ||
<ion-label>Soft Shape</ion-label> | ||
<ion-icon aria-hidden="true" name="triangle-outline"></ion-icon> | ||
</ion-tab-button> | ||
|
||
<ion-tab-button id="round-tab-button" shape="round"> | ||
<ion-label>Round Shape</ion-label> | ||
<ion-icon aria-hidden="true" name="triangle-outline"></ion-icon> | ||
</ion-tab-button> | ||
|
||
<ion-tab-button id="rect-tab-button" shape="rectangular"> | ||
<ion-label>Rectangular Shape</ion-label> | ||
<ion-icon aria-hidden="true" name="triangle-outline"></ion-icon> | ||
</ion-tab-button> | ||
</ion-tab-bar> | ||
</ion-content> | ||
|
||
<style> | ||
ion-tab-bar { | ||
background: #d4d4d4; | ||
} | ||
</style> | ||
</ion-app> | ||
</body> | ||
</html> |
51 changes: 51 additions & 0 deletions
51
core/src/components/tab-button/test/shape/tab-button.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { expect } from '@playwright/test'; | ||
import { configs, test } from '@utils/test/playwright'; | ||
import type { E2EPage, E2EPageOptions, ScreenshotFn } from '@utils/test/playwright'; | ||
|
||
class TabButtonFixture { | ||
readonly page: E2EPage; | ||
|
||
constructor(page: E2EPage) { | ||
this.page = page; | ||
} | ||
|
||
async goto(config: E2EPageOptions) { | ||
const { page } = this; | ||
await page.goto(`/src/components/tab-button/test/shape`, config); | ||
} | ||
|
||
async screenshot(screenshotModifier: string, screenshot: ScreenshotFn, buttonId: string) { | ||
const { page } = this; | ||
|
||
const screenshotString = screenshot(`tab-button-${screenshotModifier}`); | ||
const tabButton = page.locator(buttonId); | ||
|
||
await expect(tabButton).toHaveScreenshot(screenshotString); | ||
} | ||
} | ||
|
||
/** | ||
* This behavior does not vary across directions. | ||
*/ | ||
configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ config, screenshot, title }) => { | ||
test.describe(title('tab-button: shape'), () => { | ||
let tabButtonFixture: TabButtonFixture; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
tabButtonFixture = new TabButtonFixture(page); | ||
await tabButtonFixture.goto(config); | ||
}); | ||
|
||
test('should render a soft tab button', async () => { | ||
await tabButtonFixture.screenshot('shape-soft', screenshot, '#soft-tab-button'); | ||
}); | ||
|
||
test('should render a round tab button', async () => { | ||
await tabButtonFixture.screenshot('shape-round', screenshot, '#round-tab-button'); | ||
}); | ||
|
||
test('should render a rectangular tab button', async () => { | ||
await tabButtonFixture.screenshot('shape-rectangular', screenshot, '#rect-tab-button'); | ||
}); | ||
}); | ||
}); |
Binary file added
BIN
+2 KB
...apshots/tab-button-shape-rectangular-ionic-md-ltr-light-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.19 KB
...pshots/tab-button-shape-rectangular-ionic-md-ltr-light-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.07 KB
...apshots/tab-button-shape-rectangular-ionic-md-ltr-light-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.21 KB
....ts-snapshots/tab-button-shape-round-ionic-md-ltr-light-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.05 KB
...ts-snapshots/tab-button-shape-round-ionic-md-ltr-light-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.2 KB
....ts-snapshots/tab-button-shape-round-ionic-md-ltr-light-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.83 KB
...e.ts-snapshots/tab-button-shape-soft-ionic-md-ltr-light-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.91 KB
....ts-snapshots/tab-button-shape-soft-ionic-md-ltr-light-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.84 KB
...e.ts-snapshots/tab-button-shape-soft-ionic-md-ltr-light-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters