Skip to content

Commit b86725a

Browse files
committed
test: add 'search by Enter' tests
1 parent 9c9a655 commit b86725a

9 files changed

+26
-0
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

src/ReactUnipika/__tests__/ReactUnipika.visual.test.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ test('ReactUnipika: search next', async ({mount, expectScreenshot, page}) => {
1818
await expectScreenshot({component: page});
1919
});
2020

21+
test('ReactUnipika: search next by Enter', async ({mount, expectScreenshot, page}) => {
22+
await mount(<Stories.Json />, {width: 1280});
23+
24+
await page.getByTestId('qa:structuredyson:search').locator('input').fill('level10_item0');
25+
26+
await page.getByTestId('qa:structuredyson:search').locator('input').focus();
27+
await page.keyboard.press('Enter');
28+
29+
await page.getByText('level8_item3').waitFor({state: 'visible'});
30+
31+
await expectScreenshot({component: page});
32+
});
33+
2134
test('ReactUnipika: search prev', async ({mount, expectScreenshot, page}) => {
2235
await mount(<Stories.Json />, {width: 1280});
2336

@@ -27,6 +40,19 @@ test('ReactUnipika: search prev', async ({mount, expectScreenshot, page}) => {
2740
await expectScreenshot({component: page});
2841
});
2942

43+
test('ReactUnipika: search prev by SHIFT+Enter', async ({mount, expectScreenshot, page}) => {
44+
await mount(<Stories.Json />, {width: 1280});
45+
46+
await page.getByTestId('qa:structuredyson:search').locator('input').fill('level10_item0');
47+
48+
await page.getByTestId('qa:structuredyson:search').locator('input').focus();
49+
await page.keyboard.press('Shift+Enter');
50+
51+
await page.getByText('level8_item3').waitFor({state: 'visible'});
52+
53+
await expectScreenshot({component: page});
54+
});
55+
3056
test('ReactUnipika: preview', async ({mount, expectScreenshot, page}) => {
3157
await mount(<Stories.Json />, {width: 1280});
3258

0 commit comments

Comments
 (0)