From 0d6473360407e022e44997452e17aec19f356f16 Mon Sep 17 00:00:00 2001 From: Pavithra Kodmad Date: Mon, 6 May 2024 20:56:05 +1000 Subject: [PATCH] Add tests --- e2e/components/drafts/ActionBar.test.ts | 6 ++++-- packages/react/src/drafts/ActionBar/ActionBar.test.tsx | 8 -------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/e2e/components/drafts/ActionBar.test.ts b/e2e/components/drafts/ActionBar.test.ts index 675af157ca6..f7c74f0f750 100644 --- a/e2e/components/drafts/ActionBar.test.ts +++ b/e2e/components/drafts/ActionBar.test.ts @@ -40,11 +40,13 @@ test.describe('ActionBar', () => { colorScheme: theme, }, }) - + const toolbarButtonSelector = `button[data-component="IconButton"]` + await expect(page.locator(toolbarButtonSelector)).toHaveCount(10) await page.setViewportSize({width: viewports['primer.breakpoint.xs'], height: 768}) + await expect(page.locator(toolbarButtonSelector)).toHaveCount(6) const moreButtonSelector = `button[aria-label="More Comment box toolbar items"]` await page.locator(moreButtonSelector).click() - await page.getByText('Saved Replies').click() + await expect(page.locator('ul[role="menu"]>li')).toHaveCount(5) }) }) } diff --git a/packages/react/src/drafts/ActionBar/ActionBar.test.tsx b/packages/react/src/drafts/ActionBar/ActionBar.test.tsx index d9ee3830e8d..0b8195dd230 100644 --- a/packages/react/src/drafts/ActionBar/ActionBar.test.tsx +++ b/packages/react/src/drafts/ActionBar/ActionBar.test.tsx @@ -33,11 +33,3 @@ describe('ActionBar', () => { expect(results).toHaveNoViolations() }) }) - -/* Test suite -1. Did it render all the iconbuttons? -2. Are all of them variant invisible? -3. Dont add any normal button? -4. Reduce size of container and see if all the icon buttons went into the dropdown? Did dividers move correctly? -5. Aria labels are all correct? -*/