2021-11-12 17:27:10 +01:00
|
|
|
describe('Editor', () => {
|
|
|
|
const globalEditorExcludes =
|
|
|
|
'.skiplink, .sidebar__collapse-toggle, #wagtail-sidebar, li[aria-controls^="tab-"]';
|
|
|
|
beforeAll(async () => {
|
2021-12-12 01:07:30 +01:00
|
|
|
await page.goto(`${TEST_ORIGIN}/admin/pages/add/demosite/standardpage/2/`);
|
2021-11-12 17:27:10 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it('has the right heading', async () => {
|
|
|
|
const pageHeader = await page.$('h1');
|
|
|
|
const pageHeaderValue = await pageHeader.evaluate((el) => el.textContent);
|
2022-04-08 18:36:47 +02:00
|
|
|
expect(pageHeaderValue).toContain('New: Standard page');
|
2021-11-12 17:27:10 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it('axe', async () => {
|
|
|
|
await expect(page).toPassAxeTests({
|
|
|
|
exclude: `${globalEditorExcludes}, [aria-describedby^="placeholder-"]`,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('axe InlinePanel', async () => {
|
|
|
|
const toggle = await page.$('.sidebar__collapse-toggle');
|
|
|
|
toggle.click();
|
|
|
|
const trigger = await page.$('#id_carousel_items-ADD');
|
|
|
|
trigger.click();
|
|
|
|
await expect(page).toPassAxeTests({
|
|
|
|
exclude: `${globalEditorExcludes}, [aria-describedby^="placeholder-"]`,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2022-07-25 16:20:19 +02:00
|
|
|
it.skip('axe embed chooser', async () => {
|
2021-11-12 17:27:10 +01:00
|
|
|
const trigger = await page.$('.Draftail-Editor [name="EMBED"]');
|
|
|
|
await Promise.all([
|
|
|
|
trigger.click(),
|
|
|
|
page.waitForSelector('.embed-form', { visible: true }),
|
|
|
|
]);
|
|
|
|
await expect(page).toPassAxeTests({
|
|
|
|
exclude: `${globalEditorExcludes}, [aria-describedby^="placeholder-"], .modal`,
|
|
|
|
});
|
|
|
|
await Promise.all([
|
|
|
|
await page.keyboard.press('Escape'),
|
|
|
|
page.waitForSelector('.Draftail-Editor--readonly', { hidden: true }),
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
|
2022-08-03 13:32:29 +02:00
|
|
|
it.skip('axe image chooser', async () => {
|
2021-11-12 17:27:10 +01:00
|
|
|
const trigger = await page.$('.Draftail-Editor [name="IMAGE"]');
|
|
|
|
await Promise.all([
|
|
|
|
trigger.click(),
|
|
|
|
page.waitForSelector('.image-search', { visible: true }),
|
|
|
|
]);
|
|
|
|
await expect(page).toPassAxeTests({
|
|
|
|
exclude: `${globalEditorExcludes}, [aria-describedby^="placeholder-"], .modal`,
|
|
|
|
});
|
|
|
|
await Promise.all([
|
|
|
|
await page.keyboard.press('Escape'),
|
|
|
|
page.waitForSelector('.Draftail-Editor--readonly', { hidden: true }),
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
|
2022-08-03 13:32:29 +02:00
|
|
|
it.skip('axe page chooser', async () => {
|
2021-11-12 17:27:10 +01:00
|
|
|
const trigger = await page.$('.Draftail-Editor [name="LINK"]');
|
|
|
|
await Promise.all([
|
|
|
|
trigger.click(),
|
|
|
|
page.waitForSelector('.page-results', { visible: true }),
|
|
|
|
]);
|
|
|
|
await expect(page).toPassAxeTests({
|
|
|
|
exclude: `${globalEditorExcludes}, [aria-describedby^="placeholder-"], .modal`,
|
|
|
|
});
|
|
|
|
await Promise.all([
|
|
|
|
await page.keyboard.press('Escape'),
|
|
|
|
page.waitForSelector('.Draftail-Editor--readonly', { hidden: true }),
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
});
|