-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: description visible in regular menu #4199
- Loading branch information
1 parent
471992d
commit 0b9789a
Showing
2 changed files
with
114 additions
and
2 deletions.
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
e2e-tests/specs/customizer/hfg/hfg-menu-item-description.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { setCustomizeSettings } from '../../../utils'; | ||
import data from '../../../fixtures/customizer/hfg/menu-item-alignment-setup.json'; | ||
|
||
test.describe('Menu item description', function () { | ||
test.beforeAll(async ({ browser, request, baseURL }) => { | ||
await setCustomizeSettings('hfgMenuItemAlignment', data, { | ||
request, | ||
baseURL, | ||
}); | ||
|
||
const context = await browser.newContext(); | ||
const page = await context.newPage(); | ||
|
||
await page.goto('/wp-admin/edit-tags.php?taxonomy=category'); | ||
await page.getByRole('textbox', { name: 'Name' }).click(); | ||
await page | ||
.getByRole('textbox', { name: 'Name' }) | ||
.fill('ADescriptionCat'); | ||
await page.getByRole('textbox', { name: 'Slug' }).click(); | ||
await page | ||
.getByRole('textbox', { name: 'Slug' }) | ||
.fill('adescriptioncat'); | ||
await page.getByRole('textbox', { name: 'Description' }).click(); | ||
await page | ||
.getByRole('textbox', { name: 'Description' }) | ||
.fill('Some Description for the category'); | ||
await page.getByRole('button', { name: 'Add New Category' }).click(); | ||
await page.goto('wp-admin/nav-menus.php'); | ||
|
||
// await page.getByRole('button', { name: 'Screen Options ' }).click(); | ||
// await page.getByLabel('Description', { exact: true }).check(); | ||
// await page.getByRole('button', { name: 'Screen Options ' }).click(); | ||
// await page.getByRole('link', { name: 'Level 2. Sub item number 1 under Level 1.' }).scrollIntoViewIfNeeded(); | ||
// await page.getByRole('link', { name: 'Level 2. Sub item number 1 under Level 1.' }).click(); | ||
// await page.getByRole('textbox', { name: 'Description The description will be displayed in the menu if the active theme supports it.' }).click(); | ||
// await page.getByRole('textbox', { name: 'Description The description will be displayed in the menu if the active theme supports it.' }).fill('Product Description'); | ||
// await page.getByRole('button', { name: 'Save Menu' }).click(); | ||
|
||
await page | ||
.getByRole('heading', { | ||
name: 'Categories Press return or enter to open this section ', | ||
}) | ||
.click(); | ||
await page | ||
.locator('#taxonomy-category-tabs') | ||
.getByRole('link', { name: 'View All' }) | ||
.click(); | ||
await page.getByLabel('ADescriptionCat').check(); | ||
|
||
await Promise.all([ | ||
page.waitForResponse( | ||
(res) => | ||
res.url().includes('wp-admin/admin-ajax.php') && | ||
res.status() === 200 | ||
), | ||
page.getByRole('button', { name: 'Add to Menu' }).click(), | ||
]); | ||
|
||
await page.keyboard.press('End'); | ||
await page.waitForTimeout(500); | ||
|
||
await expect( | ||
page.locator('#menu-to-edit li.menu-item:last-child a.item-edit') | ||
).toBeVisible(); | ||
await page | ||
.locator('#menu-to-edit li.menu-item:last-child a.item-edit') | ||
.click({ force: true }); | ||
await page.waitForTimeout(500); | ||
await page | ||
.locator( | ||
'#menu-to-edit li.menu-item:last-child .menu-item-settings button.menus-move-right' | ||
) | ||
.click({ force: true }); | ||
await page.getByRole('button', { name: 'Save Menu' }).click(); | ||
}); | ||
|
||
test.afterAll(async ({ browser, request, baseURL }) => { | ||
const context = await browser.newContext(); | ||
const page = await context.newPage(); | ||
|
||
await page.goto('/wp-admin/edit-tags.php?taxonomy=category'); | ||
|
||
await page.getByLabel('Select ADescriptionCat').check(); | ||
await page.locator('#bulk-action-selector-top').selectOption('delete'); | ||
await page.locator('#doaction').click(); | ||
}); | ||
|
||
test('Checks up item alignment', async ({ page }) => { | ||
await page.goto('/?test_data=hfgMenuItemAlignment'); | ||
|
||
await page | ||
.locator( | ||
'.primary-menu-ul.nav-ul.menu-desktop li.menu-item.menu-item-has-children:last-child' | ||
) | ||
.hover(); | ||
await expect(page.locator('.neve-mm-description')).toHaveCount(0); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters