-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActionBar: Add a few fixes and tests #4536
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e978197
Add a few fixes and a test plan
pksjce 22e3782
Add test for overflow
pksjce fbdb9a3
Add overflow e2e test to actionbar
pksjce 0d64733
Add tests
pksjce ade0bb5
Create mean-terms-bathe.md
pksjce 669b88c
test(vrt): update snapshots
pksjce 7af6efc
Merge branch 'main' into action-bar-fixes
pksjce File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💖