Skip to content

Commit

Permalink
chore(demo-playwright): test for Error (#6022)
Browse files Browse the repository at this point in the history
  • Loading branch information
AtharvChandratre authored Nov 21, 2023
1 parent 4e5171e commit 1e624c0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
13 changes: 0 additions & 13 deletions projects/demo-cypress/cypress/tests/core/error/tui-error.cy.ts

This file was deleted.

21 changes: 21 additions & 0 deletions projects/demo-playwright/tests/core/error/error.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {TuiDocumentationPagePO, tuiGoto} from '@demo-playwright/utils';
import {expect, test} from '@playwright/test';

test.describe(`TuiError`, () => {
test(`No extra space between content`, async ({page}) => {
await tuiGoto(page, `components/error#base`);
const example = new TuiDocumentationPagePO(page).getExample(`#base`);

const checkbox = example.locator(`tui-toggle input[type="checkbox"]`);
const error = example.locator(`tui-error`);

await expect(error).not.toBeVisible();
await checkbox.click();

await expect(checkbox).toBeChecked();
await expect(error).toBeVisible();
await expect(error).toHaveText(`An error`);

await expect(example).toHaveScreenshot(`01-error.png`);
});
});

0 comments on commit 1e624c0

Please sign in to comment.