GitHub

Original file line numberDiff line numberDiff line change

@@ -29,6 +29,9 @@

2929

<ion-content class="ion-padding">

3030

<button id="baseline" onclick="openToast(baselineConfig)">Open Baseline Layout Toast</button>

3131

<button id="stacked" onclick="openToast(stackedConfig)">Open Stacked Layout Toast</button>

32+

<button id="stacked-long-message" onclick="openToast(stackedLongMessageConfig)">

33+

Open Stacked Layout Toast with Long Message

34+

</button>

3235

</ion-content>

3336
3437

<script>

@@ -52,6 +55,13 @@

5255

message: 'This is a stacked layout toast.',

5356

layout: 'stacked',

5457

};

58+
59+

const stackedLongMessageConfig = {

60+

...baselineConfig,

61+

message:

62+

'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum in elit varius, maximus sem in, bibendum justo.',

63+

layout: 'stacked',

64+

};

5565

</script>

5666

</ion-app>

5767

</body>

Original file line numberDiff line numberDiff line change

@@ -3,7 +3,7 @@ import { configs, test } from '@utils/test/playwright';

33
44

configs().forEach(({ title, screenshot, config }) => {

55

test.describe(title('toast: stacked layout'), () => {

6-

test('should render stacked buttons', async ({ page }) => {

6+

test('should render stacked toast', async ({ page }) => {

77

await page.goto('/src/components/toast/test/layout', config);

88

const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent');

99

@@ -13,5 +13,21 @@ configs().forEach(({ title, screenshot, config }) => {

1313

const toastWrapper = page.locator('ion-toast .toast-wrapper');

1414

await expect(toastWrapper).toHaveScreenshot(screenshot(`toast-stacked`));

1515

});

16+
17+

test('should render stacked toast with long message', async ({ page }, testInfo) => {

18+

testInfo.annotations.push({

19+

type: 'issue',

20+

description: 'https://github.com/ionic-team/ionic-framework/issues/30908',

21+

});

22+
23+

await page.goto('/src/components/toast/test/layout', config);

24+

const ionToastDidPresent = await page.spyOnEvent('ionToastDidPresent');

25+
26+

await page.click('#stacked-long-message');

27+

await ionToastDidPresent.next();

28+
29+

const toastWrapper = page.locator('ion-toast .toast-wrapper');

30+

await expect(toastWrapper).toHaveScreenshot(screenshot(`toast-stacked-long-message`));

31+

});

1632

});

1733

});

Read the original on github.com ↗