Skip to content

Commit

Permalink
test(footer): add lightmode and darkmode screenshot tests for mode va…
Browse files Browse the repository at this point in the history
…riants
  • Loading branch information
max-umain committed Dec 16, 2024
1 parent eab3f65 commit 56ae419
Show file tree
Hide file tree
Showing 12 changed files with 248 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { test } from 'stencil-playwright';
import { expect } from '@playwright/test';

const componentTestPath = 'src/components/footer/test/default/primary/darkmode/index.html';

test.describe.parallel('tds-footer-default-primary-darkmode', () => {
test('renders default footer correctly', async ({ page }) => {
await page.goto(componentTestPath);
const footerComponent = page.locator('footer');
await expect(footerComponent).toHaveCount(1);

/** Check screenshot diff */
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,47 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Footer - Default</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); padding: 20px">
<tds-footer mode-variant="primary">
<div slot="start">
<tds-footer-group>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
</tds-footer-group>
</div>
<div slot="end">
<tds-footer-group>
<tds-footer-item>
<a href="#"><tds-icon name="truck"></tds-icon></a>
</tds-footer-item>
<tds-footer-item>
<a href="#"><tds-icon name="truck"></tds-icon></a>
</tds-footer-item>
<tds-footer-item>
<a href="#"><tds-icon name="truck"></tds-icon></a>
</tds-footer-item>
</tds-footer-group>
</div>
</tds-footer>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { test } from 'stencil-playwright';
import { expect } from '@playwright/test';

const componentTestPath = 'src/components/footer/test/default/primary/lightmode/index.html';

test.describe.parallel('tds-footer-default-primary-lightmode', () => {
test('renders default footer correctly', async ({ page }) => {
await page.goto(componentTestPath);
const footerComponent = page.locator('footer');
await expect(footerComponent).toHaveCount(1);

/** Check screenshot diff */
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,47 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Footer - Default</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 style="padding: 20px">
<tds-footer mode-variant="primary">
<div slot="start">
<tds-footer-group>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
</tds-footer-group>
</div>
<div slot="end">
<tds-footer-group>
<tds-footer-item>
<a href="#"><tds-icon name="truck"></tds-icon></a>
</tds-footer-item>
<tds-footer-item>
<a href="#"><tds-icon name="truck"></tds-icon></a>
</tds-footer-item>
<tds-footer-item>
<a href="#"><tds-icon name="truck"></tds-icon></a>
</tds-footer-item>
</tds-footer-group>
</div>
</tds-footer>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { test } from 'stencil-playwright';
import { expect } from '@playwright/test';

const componentTestPath = 'src/components/footer/test/default/secondary/darkmode/index.html';

test.describe.parallel('tds-footer-default-secondary-darkmode', () => {
test('renders default footer correctly', async ({ page }) => {
await page.goto(componentTestPath);
const footerComponent = page.locator('footer');
await expect(footerComponent).toHaveCount(1);

/** Check screenshot diff */
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,47 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Footer - Default</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-900); padding: 20px">
<tds-footer mode-variant="secondary">
<div slot="start">
<tds-footer-group>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
</tds-footer-group>
</div>
<div slot="end">
<tds-footer-group>
<tds-footer-item>
<a href="#"><tds-icon name="truck"></tds-icon></a>
</tds-footer-item>
<tds-footer-item>
<a href="#"><tds-icon name="truck"></tds-icon></a>
</tds-footer-item>
<tds-footer-item>
<a href="#"><tds-icon name="truck"></tds-icon></a>
</tds-footer-item>
</tds-footer-group>
</div>
</tds-footer>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { test } from 'stencil-playwright';
import { expect } from '@playwright/test';

const componentTestPath = 'src/components/footer/test/default/secondary/lightmode/index.html';

test.describe.parallel('tds-footer-default-secondary-lightmode', () => {
test('renders default footer correctly', async ({ page }) => {
await page.goto(componentTestPath);
const footerComponent = page.locator('footer');
await expect(footerComponent).toHaveCount(1);

/** Check screenshot diff */
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,47 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Footer - Default</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 style="background-color: var(--tds-grey-50); padding: 20px">
<tds-footer mode-variant="secondary">
<div slot="start">
<tds-footer-group>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
<tds-footer-item>
<a href="#">Link text</a>
</tds-footer-item>
</tds-footer-group>
</div>
<div slot="end">
<tds-footer-group>
<tds-footer-item>
<a href="#"><tds-icon name="truck"></tds-icon></a>
</tds-footer-item>
<tds-footer-item>
<a href="#"><tds-icon name="truck"></tds-icon></a>
</tds-footer-item>
<tds-footer-item>
<a href="#"><tds-icon name="truck"></tds-icon></a>
</tds-footer-item>
</tds-footer-group>
</div>
</tds-footer>
</body>
</html>

0 comments on commit 56ae419

Please sign in to comment.