Skip to content

Commit

Permalink
chore: add E2E test
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed May 20, 2024
1 parent 421de81 commit b908892
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"neve_ran_builder_migration": true,
"neve_migrated_builders": true,
"neve_ran_migrations": true,
"neve_had_old_skin": true,
"neve_migrated_hfg_colors": true,
"nav_menu_locations": {
"primary": 176
},
"header_palette_switch_icon_size": "{\"mobile\":16,\"tablet\":16,\"desktop\":44}",
"hfg_header_layout_v2": "{\"desktop\":{\"top\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[{\"id\":\"secondary-menu\"}]},\"main\":{\"left\":[{\"id\":\"logo\"}],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]},\"bottom\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]}},\"mobile\":{\"top\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]},\"main\":{\"left\":[{\"id\":\"logo\"}],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[{\"id\":\"nav-icon\"}]},\"bottom\":{\"left\":[],\"c-left\":[],\"center\":[],\"c-right\":[],\"right\":[]},\"sidebar\":[{\"id\":\"secondary-menu\"}]}}\";}",
"neve_new_skin": "new"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { test, expect } from '@playwright/test';
import { setCustomizeSettings } from '../../../utils';
import secondaryMenuSetup from '../../../fixtures/customizer/hfg/hfg-secondary-menu-component.json';

test.describe('Secondary Nav', async () => {
test('Only Secondary Nav', async ({ page, request, baseURL }) => {
await setCustomizeSettings('hfgSearchFormIcon', secondaryMenuSetup, {
request,
baseURL,
});
await page.goto('/?test_name=hfgSecondaryNav');

await page.setViewportSize({ width: 375, height: 812 }); // Mobile Mode.

await page.getByRole('button', { name: 'Navigation Menu' }).click();

await expect(
page.getByRole('link', { name: 'Sample Page' })
).toBeVisible(); // Secondary_Nav_Walker enqueues the necessary JS to make the menu work.
});
});

0 comments on commit b908892

Please sign in to comment.