-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ActionBar: Add a few fixes and tests (#4536)
* Add a few fixes and a test plan * Add test for overflow * Add overflow e2e test to actionbar * Add tests * Create mean-terms-bathe.md * test(vrt): update snapshots --------- Co-authored-by: pksjce <pksjce@users.noreply.github.com>
- Loading branch information
Showing
13 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
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,5 @@ | ||
--- | ||
"@primer/react": patch | ||
--- | ||
|
||
ActionBar: Add a few fixes and relevant tests |
Binary file added
BIN
+9.87 KB
...tionBar.test.ts-snapshots/drafts-ActionBar-CommentBox-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.74 KB
...s/ActionBar.test.ts-snapshots/drafts-ActionBar-CommentBox-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.1 KB
...nBar.test.ts-snapshots/drafts-ActionBar-CommentBox-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.87 KB
...s/drafts/ActionBar.test.ts-snapshots/drafts-ActionBar-CommentBox-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.87 KB
...tionBar.test.ts-snapshots/drafts-ActionBar-CommentBox-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.84 KB
...ionBar.test.ts-snapshots/drafts-ActionBar-CommentBox-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10 KB
...Bar.test.ts-snapshots/drafts-ActionBar-CommentBox-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.84 KB
.../drafts/ActionBar.test.ts-snapshots/drafts-ActionBar-CommentBox-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.84 KB
...ionBar.test.ts-snapshots/drafts-ActionBar-CommentBox-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,54 @@ | ||
import {test, expect} from '@playwright/test' | ||
import {visit} from '../../test-helpers/storybook' | ||
import {themes} from '../../test-helpers/themes' | ||
import {viewports} from '../../test-helpers/viewports' | ||
|
||
test.describe('ActionBar', () => { | ||
test.describe('Default state', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'drafts-components-actionbar--comment-box', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
expect(await page.screenshot()).toMatchSnapshot(`drafts.ActionBar.CommentBox.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'drafts-components-actionbar--comment-box', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
}) | ||
|
||
test.describe('ActionBar Interactions', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('Overflow interaction @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'drafts-components-actionbar--comment-box', | ||
globals: { | ||
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 expect(page.locator('ul[role="menu"]>li')).toHaveCount(5) | ||
}) | ||
}) | ||
} | ||
}) | ||
}) |
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
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