Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dependency lint-staged to v15.3.0 #10097

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 5 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"@types/webpack-env": "1.18.5",
"cpy-cli": "5.0.0",
"husky": "9.1.7",
"lint-staged": "15.2.11",
"lint-staged": "15.3.0",
"ng-morph": "4.8.4",
"ng-packagr": "16.2.3",
"ngx-highlightjs": "10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
import {TuiDocumentationPagePO, tuiGoto} from '@demo-playwright/utils';
import {expect, test} from '@playwright/test';

import {scrollToExample} from '../../../utils/scroll-to-example';

test.describe('DataList', () => {
test('Custom list', async ({page}) => {
await tuiGoto(page, DemoRoute.DataList);

const documentationPagePO = new TuiDocumentationPagePO(page);
const example = documentationPagePO.getExample('#custom');

await example.scrollIntoViewIfNeeded();
await scrollToExample(page, example);
await example.locator('tui-select').click();
await page.locator('tui-dropdown [tuiOption]').nth(0).hover();

Expand All @@ -21,7 +23,7 @@
const documentationPagePO = new TuiDocumentationPagePO(page);
const example = documentationPagePO.getExample('#links');

await example.scrollIntoViewIfNeeded();
await scrollToExample(page, example);
await example.locator('[tuiDropdownOpen]').click();
await page.locator('tui-dropdown [tuiOption]').nth(0).hover();
await page.waitForTimeout(300);
Expand All @@ -30,7 +32,7 @@
});

test('Submenu', async ({page, browserName}) => {
test.skip(

Check warning on line 35 in projects/demo-playwright/tests/core/data-list/data-list.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected use of the `.skip()` annotation
browserName !== 'chromium',
// TODO: bug https://github.com/taiga-family/taiga-ui/issues/9837
'This feature is only relevant in Chrome',
Expand All @@ -42,7 +44,7 @@
const documentationPagePO = new TuiDocumentationPagePO(page);
const example = documentationPagePO.getExample('#submenu');

await example.scrollIntoViewIfNeeded();
await scrollToExample(page, example);
await documentationPagePO.prepareBeforeScreenshot();

await example.locator('button').click();
Expand Down Expand Up @@ -93,40 +95,29 @@
await expect(page).toHaveScreenshot('03-8-data-list.png');
});

test('Form control', async ({page, browserName}) => {
test.skip(
browserName !== 'chromium',
// TODO: why does this test keep failing in safari
'This feature is only relevant in Chrome',
);

test('Form control', async ({page}) => {
await tuiGoto(page, DemoRoute.DataList);

const documentationPagePO = new TuiDocumentationPagePO(page);
const example = documentationPagePO.getExample('#control');

await example.scrollIntoViewIfNeeded();
await scrollToExample(page, example);
await example.locator('button').first().click();
await documentationPagePO.prepareBeforeScreenshot();

await expect(page.locator('tui-dropdown')).toHaveScreenshot('04-data-list.png');
});

test('Complex', async ({page, browserName}) => {
test.skip(
browserName !== 'chromium',
// TODO: check later
'This feature is only relevant in Chrome',
);

test('Complex', async ({page}) => {
await page.setViewportSize({width: 1400, height: 500});
await tuiGoto(page, DemoRoute.DataList);

const documentationPagePO = new TuiDocumentationPagePO(page);
const example = documentationPagePO.getExample('#complex');

await example.scrollIntoViewIfNeeded();
await scrollToExample(page, example);
await example.locator('button').click();

await documentationPagePO.hideContent();
await documentationPagePO.prepareBeforeScreenshot();

await expect(page).toHaveScreenshot('05-data-list.png');
Expand Down Expand Up @@ -171,7 +162,7 @@
await page.locator('[automation-id="tui-data-list-calendar-option"]').click();
await page.locator('[automation-id="tui-calendar-sheet__cell"]').nth(4).click();

await expect(page).toHaveScreenshot('09-data-list.png');

Check failure on line 165 in projects/demo-playwright/tests/core/data-list/data-list.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 2 of 9

[webkit] › tests/core/data-list/data-list.pw.spec.ts:110:9 › DataList › Complex

1) [webkit] › tests/core/data-list/data-list.pw.spec.ts:110:9 › DataList › Complex ─────────────── Error: Timed out 5000ms waiting for expect(page).toHaveScreenshot(expected) Timeout 5000ms exceeded. Call log: - expect.toHaveScreenshot(09-data-list.png) with timeout 5000ms - generating new stable screenshot expectation - taking page screenshot - disabled all CSS animations - waiting for fonts to load... - Timeout 5000ms exceeded. 163 | await page.locator('[automation-id="tui-calendar-sheet__cell"]').nth(4).click(); 164 | > 165 | await expect(page).toHaveScreenshot('09-data-list.png'); | ^ 166 | }); 167 | 168 | test('Options with long text', async ({page}) => { at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/core/data-list/data-list.pw.spec.ts:165:28
});

test('Options with long text', async ({page}) => {
Expand All @@ -181,8 +172,10 @@
const documentationPagePO = new TuiDocumentationPagePO(page);
const example = documentationPagePO.getExample('#long-text-options');

await example.scrollIntoViewIfNeeded();
await scrollToExample(page, example);
await example.locator('button').click();

await documentationPagePO.hideContent();
await documentationPagePO.prepareBeforeScreenshot();

await expect(page).toHaveScreenshot('10-data-list.png');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {DemoRoute} from '@demo/routes';
import {tuiGoto} from '@demo-playwright/utils';
import {TuiDocumentationApiPagePO, tuiGoto} from '@demo-playwright/utils';
import {expect, test} from '@playwright/test';

import {
Expand All @@ -19,18 +19,26 @@ test.describe('ActionBar', () => {

test('works', async ({page}) => {
await tuiGoto(page, DemoRoute.ActionBar);

const api = new TuiDocumentationApiPagePO(page);
const example = page.locator('#size--m');
const showActionBarButton = example.locator('label').first();

await showActionBarButton.click();
const actionBarExample = page.locator('tui-action-bar');

await api.hideContent();
await api.prepareBeforeScreenshot();

await expect(actionBarExample).toHaveScreenshot('01-actions-bar-mobile.png');

const more = actionBarExample.locator('button:has-text("More")');

await more.click();

await api.hideContent();
await api.prepareBeforeScreenshot();

await expect(actionBarExample).toHaveScreenshot(
'01-action-bar-mobile-expanded.png',
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {DemoRoute} from '@demo/routes';
import {tuiGoto} from '@demo-playwright/utils';
import {TuiDocumentationApiPagePO, tuiGoto} from '@demo-playwright/utils';
import {expect, test} from '@playwright/test';

test.describe('ActionBar', () => {
Expand All @@ -9,23 +9,33 @@ test.describe('ActionBar', () => {

test('works', async ({page}) => {
await tuiGoto(page, DemoRoute.ActionBar);

const api = new TuiDocumentationApiPagePO(page);
const example = page.locator('#size--m');
const showActionBarButton = example.locator('label').first();

await showActionBarButton.click();
const actionBarExample = page.locator('tui-action-bar');

await api.hideContent();
await api.prepareBeforeScreenshot();

await expect(actionBarExample).toHaveScreenshot('01-actions-bar.png');
});

test('should show on top', async ({page}) => {
await tuiGoto(page, DemoRoute.ActionBar);

const api = new TuiDocumentationApiPagePO(page);
const example = page.locator('#top-position');
const showActionBarButton = example.getByTestId('open-table-bar-on-top').first();

await showActionBarButton.click();
const actionBarExample = page.locator('tui-action-bar');

await api.hideContent();
await api.prepareBeforeScreenshot();

await expect(actionBarExample).toHaveScreenshot('02-actions-bar.png');
});
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import {DemoRoute} from '@demo/routes';
import {TuiComboBoxPO, TuiDocumentationPagePO, tuiGoto} from '@demo-playwright/utils';
import {
TuiComboBoxPO,
TuiDocumentationPagePO,
tuiGoto,
waitIcons,
} from '@demo-playwright/utils';
import {expect, test} from '@playwright/test';

import {scrollToExample} from '../../../utils/scroll-to-example';

test.describe('ComboBox', () => {
test.use({viewport: {width: 500, height: 500}});

Expand All @@ -12,8 +19,7 @@ test.describe('ComboBox', () => {
const example = documentationPage.getExample('#ignore-disabled');
const input = example.locator('tui-combo-box input[tuiTextfieldLegacy]');

await example.scrollIntoViewIfNeeded();
await page.waitForTimeout(300); // safari flaky
await scrollToExample(page, example);
await input.click();

await expect(page).toHaveScreenshot('01-combobox-dont-allow-disabled-01.png');
Expand All @@ -23,6 +29,7 @@ test.describe('ComboBox', () => {
await expect(page).toHaveScreenshot('01-combobox-dont-allow-disabled-02.png');

await page.click('body');
await scrollToExample(page, example);

await expect(page).toHaveScreenshot('01-combobox-dont-allow-disabled-03.png');

Expand All @@ -46,7 +53,10 @@ test.describe('ComboBox', () => {
const comboBoxPO = new TuiComboBoxPO(apiPageExample);
const textfield = comboBoxPO.textfield.first();

await page.waitForTimeout(300); // safari flaky
await waitIcons({
page,
icons: await page.locator('tui-icon >> visible=true').all(),
});

await expect(page).toHaveScreenshot(
`search-should-not-be-reset-strict-${strict}.png`,
Expand Down
10 changes: 10 additions & 0 deletions projects/demo-playwright/utils/scroll-to-example.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type {Locator, Page} from '@playwright/test';

export async function scrollToExample(page: Page, example: Locator): Promise<void> {
await page.evaluate(
(view) => window.scrollTo({top: view?.y, behavior: 'auto'}),
await example.boundingBox(),
);

await page.waitForTimeout(500); // flaky
}
Loading