Skip to content

Commit

Permalink
test(text-field): add test with helper text
Browse files Browse the repository at this point in the history
  • Loading branch information
max-umain committed Dec 20, 2024
1 parent 802f24e commit 83691c4
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Text Field - Read Only with Suffix</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>
<tds-text-field
type="text"
size="lg"
state="default"
label="Label"
label-position="no label"
placeholder="Placeholder"
helper="Helper text"
></tds-text-field>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { test } from 'stencil-playwright';
import { expect } from '@playwright/test';
import {
testConfigurations,
getTestDescribeText,
setupPage,
} from '../../../../utils/testConfiguration';

// Defined once for reuse
const componentTestPath = 'src/components/text-field/test/with-helper-text/index.html';
const componentName = 'tds-text-field';
const testDescription = 'TdsTextField - with helper text';

testConfigurations.withModeVariants.forEach((config) => {
test.describe.parallel(getTestDescribeText(config, testDescription), () => {
test.beforeEach(async ({ page }) => {
await setupPage(page, config, componentTestPath, componentName);
});

test('renders text-field with helper text', async ({ page }) => {
/* 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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 83691c4

Please sign in to comment.