Skip to content

Commit 1d1e01c

Browse files
committed
test(tab-bar): use correct code syntax
1 parent 522aafa commit 1d1e01c

7 files changed

+45
-7
lines changed

core/src/components/tab-bar/test/expand/tab-bar.e2e.ts

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,39 @@ configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ title, screensh
1111
await page.setContent(
1212
`
1313
<style>
14+
:root {
15+
background: #ccc7c7;
16+
}
17+
1418
.container {
15-
padding: 20px 10px;
19+
padding: 20px 10px;
1620
}
1721
</style>
1822
1923
<ion-content>
2024
<div class="container">
21-
<ion-tab-bar expand="full"/>
25+
<ion-tab-bar expand="full">
26+
<ion-tab-button tab="1">
27+
<ion-icon name="triangle-outline"></ion-icon>
28+
<ion-label>Label</ion-label>
29+
</ion-tab-button>
30+
31+
<ion-tab-button tab="2">
32+
<ion-icon name="triangle-outline"></ion-icon>
33+
<ion-label>Label</ion-label>
34+
</ion-tab-button>
35+
36+
<ion-tab-button tab="3">
37+
<ion-icon name="triangle-outline"></ion-icon>
38+
<ion-label>Label</ion-label>
39+
</ion-tab-button>
40+
</ion-tab-bar>
2241
</div>
2342
</ion-content>
2443
`,
2544
config
2645
);
2746

28-
// Used the `ion-content` element to take the screenshot because the `ion-tab-bar`element would not be visible otherwise
2947
const container = page.locator('.container');
3048

3149
await expect(container).toHaveScreenshot(screenshot(`tab-bar-expand-full`));
@@ -37,22 +55,42 @@ configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ title, screensh
3755
await page.setContent(
3856
`
3957
<style>
58+
:root {
59+
background: #ccc7c7;
60+
}
61+
4062
.container {
41-
width: 55px;
42-
height: 95px;
63+
padding: 20px 10px;
64+
/* Size is needed because tab bar compact has position absolute and will not capture correctly. */
65+
width: 225px;
66+
height: 96px;
4367
}
4468
</style>
4569
4670
<ion-content>
4771
<div class="container">
48-
<ion-tab-bar expand="compact"/>
72+
<ion-tab-bar expand="compact">
73+
<ion-tab-button tab="1">
74+
<ion-icon name="triangle-outline"></ion-icon>
75+
<ion-label>Label</ion-label>
76+
</ion-tab-button>
77+
78+
<ion-tab-button tab="2">
79+
<ion-icon name="triangle-outline"></ion-icon>
80+
<ion-label>Label</ion-label>
81+
</ion-tab-button>
82+
83+
<ion-tab-button tab="3">
84+
<ion-icon name="triangle-outline"></ion-icon>
85+
<ion-label>Label</ion-label>
86+
</ion-tab-button>
87+
</ion-tab-bar>
4988
</div>
5089
</ion-content>
5190
`,
5291
config
5392
);
5493

55-
// Used the `ion-content` element to take the screenshot because the `ion-tab-bar` element would not be visible otherwise
5694
const container = page.locator('.container');
5795

5896
await expect(container).toHaveScreenshot(screenshot(`tab-bar-expand-compact`));
1.86 KB
Loading
Loading
1.94 KB
Loading
1.21 KB
Loading
2.03 KB
Loading
1.25 KB
Loading

0 commit comments

Comments
 (0)