-
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.
Merge pull request #4200 from Codeinwp/fix/menu_item_description
fix: description visible in regular menu
- Loading branch information
Showing
2 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
90 changes: 90 additions & 0 deletions
90
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,90 @@ | ||
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('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