-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Storybook): Resolve storybook docs styling in Firefox
Storybook obscures components that have hidden elements (think ContextMenu or DatePicker) when viewed with the Firefox browser. This made the docs section almost unusable in Firefox. The only solution at this time appears to be overiding some Storybook styles. storybookjs/storybook#16714 storybookjs/storybook#8928 Included a `ContextMenu` cypress test to help catch the issue with Storybook version bumps.
- Loading branch information
Showing
5 changed files
with
53 additions
and
3 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
4 changes: 4 additions & 0 deletions
4
packages/react-component-library/cypress/selectors/ContextMenu.ts
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,4 @@ | ||
export default { | ||
target: '[data-testid="storybook-context-menu-target"]', | ||
menu: '[data-testid="context-menu"]', | ||
} |
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import datePicker from './DatePicker' | ||
import contextMenu from './ContextMenu' | ||
import timeline from './timeline' | ||
import form from './form' | ||
|
||
export default { | ||
datePicker, | ||
contextMenu, | ||
timeline, | ||
form | ||
form, | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/react-component-library/cypress/specs/ContextMenu/index.spec.ts
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,23 @@ | ||
import { describe, cy, it, before } from 'local-cypress' | ||
|
||
import selectors from '../../selectors' | ||
|
||
// https://github.com/storybookjs/storybook/issues/8928 | ||
|
||
describe('ContextMenu', () => { | ||
describe('Storybook: Docs Mode', () => { | ||
describe('the user opens the menu', () => { | ||
before(() => { | ||
cy.visit('/iframe.html?id=context-menu--default&viewMode=docs') | ||
|
||
cy.get(selectors.contextMenu.target).eq(0).rightclick() | ||
}) | ||
|
||
it('should show the Context Menu unobscured', () => { | ||
cy.get(selectors.contextMenu.menu) | ||
.contains('This is too much text') | ||
.should('be.visible') | ||
}) | ||
}) | ||
}) | ||
}) |
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