-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ActionMenu): Add css modules tests to ActionMenu (#5308)
* chore(ActionMenu): Add css modules tests to ActionMenu * add tests * missing file * update test * test(vrt): update snapshots --------- Co-authored-by: hussam-i-am <hussam-i-am@users.noreply.github.com>
- Loading branch information
1 parent
3935811
commit 7d6842a
Showing
39 changed files
with
284 additions
and
319 deletions.
There are no files selected for viewing
Binary file added
BIN
+15.8 KB
.../ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Css-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
+16.8 KB
...ents/ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Css-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
+15.4 KB
...tionMenu.test.ts-snapshots/ActionMenu-Dev-With-Css-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
+15.9 KB
.../components/ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Css-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
+15.9 KB
.../ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Css-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
+16.1 KB
...ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Css-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
+16.2 KB
...ionMenu.test.ts-snapshots/ActionMenu-Dev-With-Css-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
+16.1 KB
...components/ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Css-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
+16.1 KB
...ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Css-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.
Binary file added
BIN
+15.8 KB
...Menu.test.ts-snapshots/ActionMenu-Dev-With-Sx-And-Css-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
+16.5 KB
...tionMenu.test.ts-snapshots/ActionMenu-Dev-With-Sx-And-Css-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
+15.4 KB
...u.test.ts-snapshots/ActionMenu-Dev-With-Sx-And-Css-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
+15.7 KB
...ents/ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Sx-And-Css-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
+15.8 KB
...Menu.test.ts-snapshots/ActionMenu-Dev-With-Sx-And-Css-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
+16 KB
...enu.test.ts-snapshots/ActionMenu-Dev-With-Sx-And-Css-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
+16.2 KB
....test.ts-snapshots/ActionMenu-Dev-With-Sx-And-Css-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
+16.2 KB
...nts/ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Sx-And-Css-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
+16 KB
...enu.test.ts-snapshots/ActionMenu-Dev-With-Sx-And-Css-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.
Binary file added
BIN
+15.8 KB
...s/ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Sx-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
+16.5 KB
...nents/ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Sx-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
+15.4 KB
...ctionMenu.test.ts-snapshots/ActionMenu-Dev-With-Sx-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
+15.7 KB
...s/components/ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Sx-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
+15.8 KB
...s/ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Sx-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
+16 KB
.../ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Sx-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
+16.2 KB
...tionMenu.test.ts-snapshots/ActionMenu-Dev-With-Sx-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
+16.2 KB
.../components/ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Sx-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+16 KB
.../ActionMenu.test.ts-snapshots/ActionMenu-Dev-With-Sx-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+15.3 KB
(330%)
...ActionMenu.test.ts-snapshots/ActionMenu-Loading-Items-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+16.1 KB
(350%)
...nts/ActionMenu.test.ts-snapshots/ActionMenu-Loading-Items-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
+14.6 KB
(320%)
...ionMenu.test.ts-snapshots/ActionMenu-Loading-Items-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+15.3 KB
(330%)
...components/ActionMenu.test.ts-snapshots/ActionMenu-Loading-Items-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
+15.3 KB
(330%)
...ActionMenu.test.ts-snapshots/ActionMenu-Loading-Items-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+15.4 KB
(330%)
...ctionMenu.test.ts-snapshots/ActionMenu-Loading-Items-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+15.5 KB
(330%)
...onMenu.test.ts-snapshots/ActionMenu-Loading-Items-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+15.4 KB
(330%)
...omponents/ActionMenu.test.ts-snapshots/ActionMenu-Loading-Items-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
+15.4 KB
(330%)
...ctionMenu.test.ts-snapshots/ActionMenu-Loading-Items-light-tritanopia-linux.png
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
122 changes: 122 additions & 0 deletions
122
packages/react/src/ActionMenu/ActionMenu.dev.stories.tsx
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,122 @@ | ||
import React from 'react' | ||
import type {Meta} from '@storybook/react' | ||
import type {ComponentProps} from '../utils/types' | ||
import {ActionMenu} from './ActionMenu' | ||
import {ActionList} from '../ActionList' | ||
import {FeatureFlags} from '../FeatureFlags' | ||
|
||
export default { | ||
title: 'Components/ActionMenu/Dev', | ||
component: ActionMenu, | ||
} as Meta<ComponentProps<typeof ActionMenu>> | ||
|
||
export const WithCss = () => ( | ||
<FeatureFlags | ||
flags={{ | ||
primer_react_css_modules_team: true, | ||
primer_react_css_modules_staff: true, | ||
primer_react_css_modules_ga: true, | ||
}} | ||
> | ||
<ActionMenu> | ||
<ActionMenu.Button className="testCustomClassnameColor">Open menu</ActionMenu.Button> | ||
<ActionMenu.Overlay width="medium" className="testCustomClassnameBorder"> | ||
<ActionList> | ||
<ActionList.Item onSelect={() => alert('Copy link clicked')}> | ||
Copy link | ||
<ActionList.TrailingVisual>⌘C</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
<ActionList.Item onSelect={() => alert('Quote reply clicked')}> | ||
Quote reply | ||
<ActionList.TrailingVisual>⌘Q</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
<ActionList.Item onSelect={() => alert('Edit comment clicked')}> | ||
Edit comment | ||
<ActionList.TrailingVisual>⌘E</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
<ActionList.Divider /> | ||
<ActionList.Item variant="danger" onSelect={() => alert('Delete file clicked')}> | ||
Delete file | ||
<ActionList.TrailingVisual>⌘D</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
</ActionList> | ||
</ActionMenu.Overlay> | ||
</ActionMenu> | ||
</FeatureFlags> | ||
) | ||
|
||
export const WithSx = () => ( | ||
<FeatureFlags | ||
flags={{ | ||
primer_react_css_modules_team: true, | ||
primer_react_css_modules_staff: true, | ||
primer_react_css_modules_ga: true, | ||
}} | ||
> | ||
<ActionMenu> | ||
<ActionMenu.Button sx={{color: 'success.emphasis'}}>Open menu</ActionMenu.Button> | ||
<ActionMenu.Overlay width="medium" sx={{border: '1px solid', borderColor: 'success.emphasis'}}> | ||
<ActionList> | ||
<ActionList.Item onSelect={() => alert('Copy link clicked')}> | ||
Copy link | ||
<ActionList.TrailingVisual>⌘C</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
<ActionList.Item onSelect={() => alert('Quote reply clicked')}> | ||
Quote reply | ||
<ActionList.TrailingVisual>⌘Q</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
<ActionList.Item onSelect={() => alert('Edit comment clicked')}> | ||
Edit comment | ||
<ActionList.TrailingVisual>⌘E</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
<ActionList.Divider /> | ||
<ActionList.Item variant="danger" onSelect={() => alert('Delete file clicked')}> | ||
Delete file | ||
<ActionList.TrailingVisual>⌘D</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
</ActionList> | ||
</ActionMenu.Overlay> | ||
</ActionMenu> | ||
</FeatureFlags> | ||
) | ||
|
||
export const WithSxAndCSS = () => ( | ||
<FeatureFlags | ||
flags={{ | ||
primer_react_css_modules_team: true, | ||
primer_react_css_modules_staff: true, | ||
primer_react_css_modules_ga: true, | ||
}} | ||
> | ||
<ActionMenu> | ||
<ActionMenu.Button sx={{color: 'success.emphasis'}} className="testCustomClassnameColor"> | ||
Open menu | ||
</ActionMenu.Button> | ||
<ActionMenu.Overlay | ||
width="medium" | ||
className="testCustomClassnameBorder" | ||
sx={{border: '1px solid', borderColor: 'success.emphasis'}} | ||
> | ||
<ActionList> | ||
<ActionList.Item onSelect={() => alert('Copy link clicked')}> | ||
Copy link | ||
<ActionList.TrailingVisual>⌘C</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
<ActionList.Item onSelect={() => alert('Quote reply clicked')}> | ||
Quote reply | ||
<ActionList.TrailingVisual>⌘Q</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
<ActionList.Item onSelect={() => alert('Edit comment clicked')}> | ||
Edit comment | ||
<ActionList.TrailingVisual>⌘E</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
<ActionList.Divider /> | ||
<ActionList.Item variant="danger" onSelect={() => alert('Delete file clicked')}> | ||
Delete file | ||
<ActionList.TrailingVisual>⌘D</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
</ActionList> | ||
</ActionMenu.Overlay> | ||
</ActionMenu> | ||
</FeatureFlags> | ||
) |
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