-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(demo-playwright): tests for
field-error
(#6133)
Co-authored-by: Vidhi Rambhia <[email protected]>
- Loading branch information
1 parent
1dcbee6
commit 7944f20
Showing
2 changed files
with
28 additions
and
15 deletions.
There are no files selected for viewing
15 changes: 0 additions & 15 deletions
15
projects/demo-cypress/cypress/tests/kit/field-error/field-error.cy.ts
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
projects/demo-playwright/tests/kit/field-error/field-error.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {tuiGoto} from '@demo-playwright/utils'; | ||
import {expect, test} from '@playwright/test'; | ||
|
||
const {describe} = test; | ||
|
||
describe(`TuiFieldError`, () => { | ||
test(`Errors of invalid control are shown correctly`, async ({page}) => { | ||
await tuiGoto(page, `/pipes/field-error`); | ||
|
||
const errorPipeInput = page | ||
.locator(`tui-field-error-pipe-example-1 input`) | ||
.first(); | ||
|
||
await errorPipeInput.focus(); | ||
|
||
await page.waitForTimeout(50); | ||
|
||
await errorPipeInput.blur(); | ||
|
||
const example = page | ||
.locator(`tui-doc-example [automation-id="tui-doc-example"]`) | ||
.first(); | ||
|
||
await expect(example).toHaveScreenshot(`shows-error-under-field.png`, { | ||
animations: `allow`, | ||
}); | ||
}); | ||
}); |