Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
10 changes: 5 additions & 5 deletions core/src/components/spinner/spinner-configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const spinners = {
return {
r: 5,
style: {
top: `${9 * Math.sin(angle)}px`,
left: `${9 * Math.cos(angle)}px`,
top: `${32 * Math.sin(angle)}%`,
left: `${32 * Math.cos(angle)}%`,
'animation-delay': animationDelay,
},
};
Expand All @@ -28,8 +28,8 @@ const spinners = {
return {
r: 5,
style: {
top: `${9 * Math.sin(angle)}px`,
left: `${9 * Math.cos(angle)}px`,
top: `${32 * Math.sin(angle)}%`,
left: `${32 * Math.cos(angle)}%`,
'animation-delay': animationDelay,
},
};
Expand Down Expand Up @@ -72,7 +72,7 @@ const spinners = {
return {
r: 6,
style: {
left: `${9 - 9 * index}px`,
left: `${32 - 32 * index}%`,
'animation-delay': animationDelay,
},
};
Expand Down
1 change: 0 additions & 1 deletion core/src/components/spinner/test/color/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

<ion-content id="content">
<ion-list>
<ion-item><ion-spinner slot="start"></ion-spinner>Platform Default Spinner</ion-item>
<ion-item
><ion-spinner color="primary" slot="start" name="lines"></ion-spinner><code>lines</code> (primary)</ion-item
>
Expand Down
4 changes: 2 additions & 2 deletions core/src/components/spinner/test/color/spinner.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';

/**
* This behavior does not vary across directions.
* This behavior does not vary across directions or modes.
*/
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
configs({ directions: ['ltr'], modes: ['md'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('spinner: color'), () => {
test.beforeEach(async ({ page }) => {
await page.goto('/src/components/spinner/test/color', config);
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.
33 changes: 33 additions & 0 deletions core/src/components/spinner/test/resize/spinner.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';

/**
* The resize behavior does not vary across directions or modes.
*/
configs({ directions: ['ltr'], modes: ['md'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('spinner: resize'), () => {
test.beforeEach(async ({ page }) => {
await page.setViewportSize({ width: 320, height: 340 });
});
test('should not have visual regressions', async ({ page }) => {
await page.setContent(
`
<ion-content id="content">
<ion-spinner name="lines"></ion-spinner>
<ion-spinner name="lines-small"></ion-spinner>
<ion-spinner name="lines-sharp"></ion-spinner>
<ion-spinner name="lines-sharp-small"></ion-spinner>
<ion-spinner name="circular"></ion-spinner>
<ion-spinner name="dots"></ion-spinner>
<ion-spinner name="bubbles"></ion-spinner>
<ion-spinner name="circles"></ion-spinner>
<ion-spinner name="crescent"></ion-spinner>
</ion-content>
`,
config
);

await expect(page.locator('#content')).toHaveScreenshot(screenshot(`spinner-resize-diff`));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you choose to remove ion-content (see other comment), then you can just do page.

Suggested change
await expect(page.locator('#content')).toHaveScreenshot(screenshot(`spinner-resize-diff`));
await expect(page).toHaveScreenshot(screenshot(`spinner-resize-diff`));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the tips!

});
});
});
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.