From ee5081f807ca19c0e3befd2a1487ea20b74c4081 Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Fri, 2 Feb 2024 11:47:52 -0800 Subject: [PATCH] test(visual): add unclipped activity names visual tests + a11y fixes (#7454) * test: add unclipped activity names visual tests + a11y fixes * lint: add additional dictionaries --- .cspell.json | 2 +- e2e/tests/visual-a11y/planning.visual.spec.js | 42 ++++++++++++++++++- src/ui/layout/PaneContainer.vue | 2 + 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.cspell.json b/.cspell.json index 5ae5a0df54..1ec6c974d1 100644 --- a/.cspell.json +++ b/.cspell.json @@ -498,7 +498,7 @@ "specced", "countup" ], - "dictionaries": ["npm", "softwareTerms", "node", "html", "css", "bash", "en_US"], + "dictionaries": ["npm", "softwareTerms", "node", "html", "css", "bash", "en_US", "en-gb", "misc"], "ignorePaths": [ "package.json", "dist/**", diff --git a/e2e/tests/visual-a11y/planning.visual.spec.js b/e2e/tests/visual-a11y/planning.visual.spec.js index bfa684779a..51783b7cf1 100644 --- a/e2e/tests/visual-a11y/planning.visual.spec.js +++ b/e2e/tests/visual-a11y/planning.visual.spec.js @@ -75,7 +75,25 @@ test.describe('Visual - Planning', () => { parent: ganttChart.uuid }); await setBoundsToSpanAllActivities(page, examplePlanSmall, ganttChart.url); - await percySnapshot(page, `Gantt Chart View (theme: ${theme})`, { + await percySnapshot(page, `Gantt Chart View (theme: ${theme}) - Clipped Activity Names`, { + scope: snapshotScope + }); + + // Expand the inspect pane and uncheck the 'Clip Activity Names' option + await page.getByRole('button', { name: 'Expand Inspect Pane' }).click(); + await page.getByRole('tab', { name: 'Config' }).click(); + await page.getByLabel('Edit Object').click(); + await page.getByLabel('Clip Activity Names').click(); + + // Close the inspect pane and save the changes + await page.getByRole('button', { name: 'Collapse Inspect Pane' }).click(); + await page.getByLabel('Save').click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + + // Dismiss the notification + await page.getByLabel('Dismiss').click(); + + await percySnapshot(page, `Gantt Chart View (theme: ${theme}) - Unclipped Activity Names`, { scope: snapshotScope }); }); @@ -98,6 +116,28 @@ test.describe('Visual - Planning', () => { await percySnapshot(page, `Gantt Chart View w/ draft status (theme: ${theme})`, { scope: snapshotScope }); + + // Expand the inspect pane and uncheck the 'Clip Activity Names' option + await page.getByRole('button', { name: 'Expand Inspect Pane' }).click(); + await page.getByRole('tab', { name: 'Config' }).click(); + await page.getByLabel('Edit Object').click(); + await page.getByLabel('Clip Activity Names').click(); + + // Close the inspect pane and save the changes + await page.getByRole('button', { name: 'Collapse Inspect Pane' }).click(); + await page.getByLabel('Save').click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + + // Dismiss the notification + await page.getByLabel('Dismiss').click(); + + await percySnapshot( + page, + `Gantt Chart View w/ draft status (theme: ${theme}) - Unclipped Activity Names`, + { + scope: snapshotScope + } + ); }); // Skipping for https://github.com/nasa/openmct/issues/7421 // test.afterEach(async ({ page }, testInfo) => { diff --git a/src/ui/layout/PaneContainer.vue b/src/ui/layout/PaneContainer.vue index 39398fa608..1e83646032 100644 --- a/src/ui/layout/PaneContainer.vue +++ b/src/ui/layout/PaneContainer.vue @@ -29,6 +29,7 @@ v-if="isCollapsable" class="l-pane__collapse-button c-icon-button" :name="collapseTitle" + :aria-label="collapseTitle" :title="collapseTitle" @click="toggleCollapse" > @@ -36,6 +37,7 @@