Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pksjce committed May 6, 2024
1 parent fbdb9a3 commit 0d64733
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 4 additions & 2 deletions e2e/components/drafts/ActionBar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})
}
Expand Down
8 changes: 0 additions & 8 deletions packages/react/src/drafts/ActionBar/ActionBar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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?
*/

0 comments on commit 0d64733

Please sign in to comment.