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

fix(kit): InputDate hold initial value with min/max defined #9623

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
chore(demo-playwright): InputDate add tests
mdlufy committed Oct 31, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 08cd8a45e1873f6b22d97bfb6d794565ef6fb96e
Original file line number Diff line number Diff line change
@@ -43,17 +43,49 @@
await expect(inputDate.textfield).toHaveScreenshot('01-input-date.png');
});

test('Click `Until today`', async ({page}) => {
test('Click `Until today`, calendar not switched to large date', async ({
page,
}) => {
await tuiGoto(page, 'components/input-date/API?items$=1');

await inputDate.textfield.click();
await calendar.itemButton.click();

await inputDate.textfield.click();

await expect(inputDate.textfield).toHaveValue('Until today');
await expect(inputDate.calendar).toHaveScreenshot(
'02-input-date-calendar.png',
);
});

test('Press backspace to remove `Until today`, textfield is empty', async ({
page,
}) => {
await tuiGoto(page, 'components/input-date/API?items$=1');

await inputDate.textfield.click();
await calendar.itemButton.click();

await inputDate.textfield.focus();
await inputDate.textfield.press('Backspace');

await expect(inputDate.textfield).toHaveValue('');

Check failure on line 73 in projects/demo-playwright/tests/kit/input-date/input-date.spec.ts

GitHub Actions / playwright / (3 of 4)

[chromium] › tests/kit/input-date/input-date.spec.ts:62:13 › InputDate › API › Press backspace to remove `Until today`

1) [chromium] › tests/kit/input-date/input-date.spec.ts:62:13 › InputDate › API › Press backspace to remove `Until today`, textfield is empty Error: Timed out 5000ms waiting for expect(locator).toHaveValue(expected) Locator: locator('#demo-content').locator('tui-input-date').getByRole('textbox') Expected string: "" Received string: "01.01.0000" Call log: - expect.toHaveValue with timeout 5000ms - waiting for locator('#demo-content').locator('tui-input-date').getByRole('textbox') - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" 71 | await inputDate.textfield.press('Backspace'); 72 | > 73 | await expect(inputDate.textfield).toHaveValue(''); | ^ 74 | await expect(inputDate.textfield).toHaveScreenshot( 75 | '03-input-date-textfield-empty.png', 76 | ); at /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/kit/input-date/input-date.spec.ts:73:47

Check failure on line 73 in projects/demo-playwright/tests/kit/input-date/input-date.spec.ts

GitHub Actions / playwright / (3 of 4)

[chromium] › tests/kit/input-date/input-date.spec.ts:62:13 › InputDate › API › Press backspace to remove `Until today`

1) [chromium] › tests/kit/input-date/input-date.spec.ts:62:13 › InputDate › API › Press backspace to remove `Until today`, textfield is empty Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toHaveValue(expected) Locator: locator('#demo-content').locator('tui-input-date').getByRole('textbox') Expected string: "" Received string: "01.01.0000" Call log: - expect.toHaveValue with timeout 5000ms - waiting for locator('#demo-content').locator('tui-input-date').getByRole('textbox') - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" - locator resolved to <input tabindex="0" tuimaskaccessor="" aria-invalid="false" _ngcontent-tui-demo-c171="" id="tui_interactive_561601061540000" class="t-input ng-untouched ng-valid ng-dirty" automation-id="tui-primitive-textfield__native-input"/> - unexpected value "01.01.0000" 71 | await inputDate.textfield.press('Backspace'); 72 | > 73 | await expect(inputDate.textfield).toHaveValue(''); | ^ 74 | await expect(inputDate.textfield).toHaveScreenshot( 75 | '03-input-date-textfield-empty.png', 76 | ); at /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/kit/input-date/input-date.spec.ts:73:47
await expect(inputDate.textfield).toHaveScreenshot(
'03-input-date-textfield-empty.png',
);
});

test('Enter item date, it converts to item date name', async ({page}) => {
await tuiGoto(page, 'components/input-date/API?items$=1');

await inputDate.textfield.focus();
await inputDate.textfield.fill('31.12.9998');

await expect(inputDate.textfield).toHaveValue('Until today');
await expect(inputDate.textfield).toHaveScreenshot(
'04-input-date-item-name.png',
);
});
});
});

Unchanged files with check annotations Beta

.getExample('#base')
.locator('button')
.click();
await expect(page).toHaveScreenshot('01-dropdown.png');

Check failure on line 13 in projects/demo-playwright/tests/core/dropdown/dropdown.spec.ts

GitHub Actions / playwright / (1 of 4)

[chromium] › tests/core/dropdown/dropdown.spec.ts:7:9 › Dropdown › base

1) [chromium] › tests/core/dropdown/dropdown.spec.ts:7:9 › Dropdown › base ─────────────────────── Error: Screenshot comparison failed: 115108 pixels (ratio 0.06 of all image pixels) are different. Expected: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/core/dropdown/dropdown.spec.ts-snapshots/01-dropdown-chromium-linux.png Received: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-core-dropdown-dropdown-Dropdown-base-chromium/01-dropdown-actual.png Diff: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-core-dropdown-dropdown-Dropdown-base-chromium/01-dropdown-diff.png Call log: - expect.toHaveScreenshot(01-dropdown.png) with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - 115108 pixels (ratio 0.06 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 115108 pixels (ratio 0.06 of all image pixels) are different. 11 | .locator('button') 12 | .click(); > 13 | await expect(page).toHaveScreenshot('01-dropdown.png'); | ^ 14 | }); 15 | 16 | test('Interesting', async ({page}) => { at /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/core/dropdown/dropdown.spec.ts:13:28

Check failure on line 13 in projects/demo-playwright/tests/core/dropdown/dropdown.spec.ts

GitHub Actions / playwright / (1 of 4)

[chromium] › tests/core/dropdown/dropdown.spec.ts:7:9 › Dropdown › base

1) [chromium] › tests/core/dropdown/dropdown.spec.ts:7:9 › Dropdown › base ─────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Screenshot comparison failed: 115075 pixels (ratio 0.06 of all image pixels) are different. Expected: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/core/dropdown/dropdown.spec.ts-snapshots/01-dropdown-chromium-linux.png Received: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-core-dropdown-dropdown-Dropdown-base-chromium-retry1/01-dropdown-actual.png Diff: /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-core-dropdown-dropdown-Dropdown-base-chromium-retry1/01-dropdown-diff.png Call log: - expect.toHaveScreenshot(01-dropdown.png) with timeout 5000ms - verifying given screenshot expectation - taking page screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - 115075 pixels (ratio 0.06 of all image pixels) are different. - waiting 100ms before taking screenshot - taking page screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - captured a stable screenshot - 115075 pixels (ratio 0.06 of all image pixels) are different. 11 | .locator('button') 12 | .click(); > 13 | await expect(page).toHaveScreenshot('01-dropdown.png'); | ^ 14 | }); 15 | 16 | test('Interesting', async ({page}) => { at /home/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/core/dropdown/dropdown.spec.ts:13:28
});
test('Interesting', async ({page}) => {