Skip to content

Commit 0d88065

Browse files
test(button): add tests for spinner inside buttons
1 parent ecf7295 commit 0d88065

28 files changed

+185
-16
lines changed

core/src/components/button/button.ionic.scss

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@
165165
::slotted(ion-icon[slot="end"]),
166166
::slotted(ion-icon[slot="icon-only"]) {
167167
font-size: inherit;
168-
169168
}
170169
}
171170

@@ -185,13 +184,13 @@
185184
::slotted(ion-spinner[slot="start"]),
186185
::slotted(ion-spinner[slot="end"]),
187186
::slotted(ion-spinner[slot="icon-only"]) {
187+
width: globals.$ion-space-500;
188188
height: globals.$ion-space-500;
189-
width: globals.$ion-space-500
190189
}
191190

192-
:host(.button-xlarge) ::slotted(ion-spinner){
193-
height: globals.$ion-space-600;
191+
:host(.button-xlarge) ::slotted(ion-spinner) {
194192
width: globals.$ion-space-600;
193+
height: globals.$ion-space-600;
195194
}
196195

197196
// Button Shapes
@@ -268,9 +267,8 @@
268267
font-size: globals.$ion-font-size-500;
269268
}
270269

271-
:host(.button-small)
272-
::slotted(ion-icon[slot="start"]),
273-
::slotted(ion-spinner[slot="start"]) {
270+
:host(.button-small) ::slotted(ion-icon[slot="start"]),
271+
::slotted(ion-spinner[slot="start"]) {
274272
@include globals.margin-horizontal(null, globals.$ion-space-200);
275273
}
276274

@@ -279,15 +277,13 @@
279277
@include globals.margin-horizontal(null, globals.$ion-space-250);
280278
}
281279

282-
:host(.button-large)
283-
::slotted(ion-icon[slot="start"]),
284-
::slotted(ion-spinner[slot="start"]) {
280+
:host(.button-large) ::slotted(ion-icon[slot="start"]),
281+
::slotted(ion-spinner[slot="start"]) {
285282
@include globals.margin-horizontal(null, globals.$ion-space-300);
286283
}
287284

288-
:host(.button-small)
289-
::slotted(ion-icon[slot="end"]),
290-
::slotted(ion-spinner[slot="end"]) {
285+
:host(.button-small) ::slotted(ion-icon[slot="end"]),
286+
::slotted(ion-spinner[slot="end"]) {
291287
@include globals.margin-horizontal(globals.$ion-space-200, null);
292288
}
293289

@@ -296,8 +292,7 @@
296292
@include globals.margin-horizontal(globals.$ion-space-250, null);
297293
}
298294

299-
:host(.button-large)
300-
::slotted(ion-icon[slot="end"]),
301-
::slotted(ion-spinner[slot="end"]) {
295+
:host(.button-large) ::slotted(ion-icon[slot="end"]),
296+
::slotted(ion-spinner[slot="end"]) {
302297
@include globals.margin-horizontal(globals.$ion-space-300, null);
303298
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { expect } from '@playwright/test';
2+
import { configs, test } from '@utils/test/playwright';
3+
4+
configs({ modes: ['ios', 'md', 'ionic-md', 'ionic-ios'] }).forEach(({ config, screenshot, title }) => {
5+
test.describe(title('button: spinner'), () => {
6+
test('should not have visual regressions', async ({ page }) => {
7+
await page.goto(`/src/components/button/test/spinner`, config);
8+
9+
await page.setIonViewport();
10+
11+
await expect(page).toHaveScreenshot(screenshot(`button-spinner`));
12+
});
13+
});
14+
});
28.4 KB
Loading
40.4 KB
Loading
25.2 KB
Loading
27.8 KB
Loading
40.7 KB
Loading
25.2 KB
Loading
26.9 KB
Loading
38.3 KB
Loading

0 commit comments

Comments
 (0)