Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 16 additions & 0 deletions core/src/components/alert/alert.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,22 @@
flex-wrap: $alert-ios-button-group-flex-wrap;
}

/**
* The right border should only be applied to the first button
* when the group has 2 or less buttons (horizontal).
* Otherwise, the right border should not be applied
* when the group has 3 or more buttons (vertical).
*/
.alert-button-group-vertical .alert-button {
border-right: none;

&:last-child {
@include rtl() {
border-right: none;
}
}
}

.alert-button {
/**
* This padding ensures that alerts
Expand Down
40 changes: 35 additions & 5 deletions core/src/components/alert/test/basic/alert.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ configs().forEach(({ config, screenshot, title }) => {
await alertFixture.screenshot('longMessage');
});

test('more than two buttons', async () => {
await alertFixture.open('#multipleButtons');
await alertFixture.screenshot('multipleButtons');
});

test('no message', async () => {
await alertFixture.open('#noMessage');
await alertFixture.screenshot('noMessage');
Expand Down Expand Up @@ -105,6 +100,41 @@ configs().forEach(({ config, screenshot, title }) => {
});
});

configs({ themes: ['light', 'dark'] }).forEach(({ config, screenshot, title }) => {
test.describe(title('should not have visual regressions'), () => {
test('more than two buttons', async ({ page }) => {
await page.setContent(
`
<ion-alert
header="Alert"
sub-header="Subtitle"
message="This is an alert message."
is-open="true"
></ion-alert>

<script>
const alert = document.querySelector('ion-alert');
alert.buttons = [
'Open Modal',
{
text: 'Delete',
id: 'delete-button',
role: 'destructive',
},
'Cancel'
];
</script>
`,
config
);

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

await expect(alert).toHaveScreenshot(screenshot(`alert-multipleButtons`));
});
});
});

class AlertFixture {
readonly page: E2EPage;
readonly screenshotFn?: (file: string) => string;
Expand Down
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.
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.
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.
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.
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.
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.
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.
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.