Skip to content

Commit

Permalink
test(spinner): add darkmode and lightmode tests, refactor and modify …
Browse files Browse the repository at this point in the history
…existing tests
  • Loading branch information
max-umain committed Dec 17, 2024
1 parent 34583ce commit 4dcf97e
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Spinner - Standard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<link rel="stylesheet" href="../../../../../../dist/tegel/tegel.css" />
<script type="module">
import { defineCustomElements } from '../../../../../../loader/index.es2017.js';
defineCustomElements();
</script>
</head>

<body class="tds-mode-dark" style="background-color: var(--tds-grey-958)">
<tds-spinner size="lg" variant="inverted"></tds-spinner>
<tds-spinner size="md" variant="inverted"></tds-spinner>
<tds-spinner size="sm" variant="inverted"></tds-spinner>
<tds-spinner size="xs" variant="inverted"></tds-spinner>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { test } from 'stencil-playwright';
import { expect } from '@playwright/test';

const componentTestPath = 'src/components/spinner/test/inverted/index.html';
const componentTestPath = 'src/components/spinner/test/inverted/darkmode/index.html';

test.describe.parallel('tds-spinner-inverted', () => {
test.describe.parallel('tds-spinner-inverted-darkmode', () => {
test('renders inverted spinner correctly', async ({ page }) => {
await page.goto(componentTestPath);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<meta charset="UTF-8" />
<title>Spinner - Standard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<link rel="stylesheet" href="../../../../../dist/tegel/tegel.css" />
<link rel="stylesheet" href="../../../../../../dist/tegel/tegel.css" />
<script type="module">
import { defineCustomElements } from '../../../../../loader/index.es2017.js';
import { defineCustomElements } from '../../../../../../loader/index.es2017.js';
defineCustomElements();
</script>
</head>

<body class="tds-mode-dark">
<body style="background-color: var(--tds-grey-50)">
<tds-spinner size="lg" variant="inverted"></tds-spinner>
<tds-spinner size="md" variant="inverted"></tds-spinner>
<tds-spinner size="sm" variant="inverted"></tds-spinner>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { test } from 'stencil-playwright';
import { expect } from '@playwright/test';

const componentTestPath = 'src/components/spinner/test/inverted/lightmode/index.html';

test.describe.parallel('tds-spinner-inverted-lightmode', () => {
test('renders inverted spinner correctly', async ({ page }) => {
await page.goto(componentTestPath);

/* Check diff on screenshot */
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Spinner - Standard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<link rel="stylesheet" href="../../../../../../dist/tegel/tegel.css" />
<script type="module">
import { defineCustomElements } from '../../../../../../loader/index.es2017.js';
defineCustomElements();
</script>
</head>

<body class="tds-mode-dark" style="background-color: var(--tds-grey-958)">
<tds-spinner size="lg" variant="standard"></tds-spinner>
<tds-spinner size="md" variant="standard"></tds-spinner>
<tds-spinner size="sm" variant="standard"></tds-spinner>
<tds-spinner size="xs" variant="standard"></tds-spinner>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { test } from 'stencil-playwright';
import { expect } from '@playwright/test';

const componentTestPath = 'src/components/spinner/test/standard/darkmode/index.html';

test.describe.parallel('tds-spinner-standard-darkmode', () => {
test('renders basic spinner correctly', async ({ page }) => {
await page.goto(componentTestPath);

/* Check diff on screenshot */
await expect(page).toHaveScreenshot({ maxDiffPixels: 0 });
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<meta charset="UTF-8" />
<title>Spinner - Standard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<link rel="stylesheet" href="../../../../../dist/tegel/tegel.css" />
<link rel="stylesheet" href="../../../../../../dist/tegel/tegel.css" />
<script type="module">
import { defineCustomElements } from '../../../../../loader/index.es2017.js';
import { defineCustomElements } from '../../../../../../loader/index.es2017.js';
defineCustomElements();
</script>
</head>

<body>
<body style="background-color: var(--tds-grey-50)">
<tds-spinner size="lg" variant="standard"></tds-spinner>
<tds-spinner size="md" variant="standard"></tds-spinner>
<tds-spinner size="sm" variant="standard"></tds-spinner>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { test } from 'stencil-playwright';
import { expect } from '@playwright/test';

const componentTestPath = 'src/components/spinner/test/standard/index.html';
const componentTestPath = 'src/components/spinner/test/standard/lightmode/index.html';

test.describe.parallel('tds-spinner-standard', () => {
test.describe.parallel('tds-spinner-standard-lightmode', () => {
test('renders basic spinner correctly', async ({ page }) => {
await page.goto(componentTestPath);

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit 4dcf97e

Please sign in to comment.