Skip to content

Commit

Permalink
Remove redundant password field test and removed associated screensho…
Browse files Browse the repository at this point in the history
…t. Update other test files to kick off tests
  • Loading branch information
chromaticWaster committed Sep 30, 2024
1 parent bb4703d commit 00524b5
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 27 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions src/number-field/NumberField.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ test(`Number Field - Max Length Behaviour`, async ({ page }) => {

const inputField = numberField.locator('#inputField');

// Update the value of the number field.
const typedValue = '12345';
const value = '1234';
await inputField.type(typedValue);
Expand Down
24 changes: 0 additions & 24 deletions src/password-field/PasswordField.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,30 +50,6 @@ test(`Password Field - Visual and Behaviour`, async ({ page }) => {
});
});

test(`Password Field - Behaviour`, async ({ page }) => {
await withCoverage(page, async () => {
await page.goto('/components/password-field/');
await page.evaluate(() => document.fonts.ready);

const passwordField = page.locator('[data-testid]').first();
await expect(passwordField).toHaveScreenshot('password-field-initial.png');

const showSlotElement = passwordField.locator('slot[name=show]');
await showSlotElement.click();

const hideSlotElement = passwordField.locator('slot[name=hide]');
await hideSlotElement.click();

const inputField = passwordField.locator('#inputField');

const valueUpdate = 'Value Update';
await passwordField.evaluate((p: PasswordField, valueUpdate) => (p.value = valueUpdate), valueUpdate);

await expect(inputField).toHaveValue(valueUpdate);
await expect(passwordField).toHaveScreenshot('password-field-value-update.png');
});
});

test(`Password Field - Max Length Behaviour`, async ({ page }) => {
await withCoverage(page, async () => {
await page.goto('/components/password-field/');
Expand Down
6 changes: 3 additions & 3 deletions src/search-field/SearchField.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ test(`Search Field - Max Length Behaviour`, async ({ page }) => {
const searchField = container.locator('[data-testid]').first();
searchField.evaluate(async (t: SearchField) => {
t.value = '';
t.maxLength = 4;
t.maxLength = 5;
await t.updateComplete;
});

Expand All @@ -60,8 +60,8 @@ test(`Search Field - Max Length Behaviour`, async ({ page }) => {

const inputField = searchField.locator('#inputField');

const typedValue = 'Tests';
const value = 'Test';
const typedValue = 'Search and you shall find';
const value = 'Search';
await inputField.type(typedValue);

await expect(searchField).toHaveScreenshot('search-field-value.png');
Expand Down

0 comments on commit 00524b5

Please sign in to comment.