diff --git a/playwright/cps-ui-kit/components/cps-progress-circular.spec.ts b/playwright/cps-ui-kit/components/cps-progress-circular.spec.ts new file mode 100644 index 000000000..5927dabe7 --- /dev/null +++ b/playwright/cps-ui-kit/components/cps-progress-circular.spec.ts @@ -0,0 +1,45 @@ +import { test, expect } from '@playwright/test'; + +test.describe('cps-progress-circular', () => { + test.beforeEach(async ({ page }) => { + await page.goto('/progress-circular'); + }); + + test.describe('Real CSS custom-property color resolves to an actual color', () => { + test('a color name real-resolves through the real stylesheet to its actual RGB value', async ({ + page + }) => { + const circle = page + .getByRole('progressbar', { name: 'Luxury progress circular' }) + .getByTestId('cps-progress-circular'); + + await expect(circle).toHaveCSS('border-top-color', 'rgb(100, 0, 50)'); + await expect(circle).toHaveCSS('width', '120px'); + }); + }); + + test.describe('Real prefers-reduced-motion slows, not stops, the spin animation', () => { + test('reduced motion real-slows the animation while keeping it running', async ({ + page + }) => { + const circle = page + .getByRole('progressbar', { name: 'Luxury progress circular' }) + .getByTestId('cps-progress-circular'); + + await expect(circle).toHaveCSS('animation-duration', '0.8s'); + await expect(circle).toHaveCSS('animation-iteration-count', 'infinite'); + + await page.emulateMedia({ reducedMotion: 'reduce' }); + await page.reload(); + const reducedCircle = page + .getByRole('progressbar', { name: 'Luxury progress circular' }) + .getByTestId('cps-progress-circular'); + + await expect(reducedCircle).toHaveCSS('animation-duration', '2.4s'); + await expect(reducedCircle).toHaveCSS( + 'animation-iteration-count', + 'infinite' + ); + }); + }); +}); diff --git a/projects/composition/src/app/pages/progress-circular-page/progress-circular-page.component.html b/projects/composition/src/app/pages/progress-circular-page/progress-circular-page.component.html index 2d6de447a..c4fc4157f 100644 --- a/projects/composition/src/app/pages/progress-circular-page/progress-circular-page.component.html +++ b/projects/composition/src/app/pages/progress-circular-page/progress-circular-page.component.html @@ -13,6 +13,7 @@ [htmlCode]="examples.variants.html">