MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / getSearchInput

Function getSearchInput

e2e/search-bar-optimized.spec.ts:4–20  ·  view source on GitHub ↗
({
  page,
  isMobile
}: {
  page: Page;
  isMobile: boolean;
})

Source from the content-addressed store, hash-verified

2import translations from '../client/i18n/locales/english/translations.json';
3
4const getSearchInput = async ({
5 page,
6 isMobile
7}: {
8 page: Page;
9 isMobile: boolean;
10}) => {
11 if (isMobile) {
12 const menuButton = page.getByRole('button', {
13 name: translations.buttons.menu
14 });
15 await expect(menuButton).toBeVisible();
16 await menuButton.click();
17 }
18
19 return page.getByLabel('Search');
20};
21
22test.describe('Search bar optimized', () => {
23 test.beforeEach(async ({ page }) => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected