Skip to content
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

Stabilize a few UI checks in Chromatic #246

Merged
merged 6 commits into from
May 24, 2023

Conversation

nickgros
Copy link
Collaborator

@nickgros nickgros commented May 19, 2023

  • Update action to reference the pull request ref so the actual changes get deployed and tested
  • Load Lato font in Storybook preview-head, since it looks like UI tests commonly get flagged as changed when the font doesn't load in time for the screenshot. See https://www.chromatic.com/docs/resource-loading
  • Update SubsectionRowRenderer demo to use existing table. The previous table used in the demo no longer exists, and when that happens we show a skeleton that uses a random number to determine its appearance, which is obviously not stable for snapshots.

@@ -1,8 +1,8 @@
<script>
window.global = window
window.sql = {}
Copy link
Collaborator Author

@nickgros nickgros May 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer needed since we removed the sql-parser package as a dependency

Comment on lines -54 to -58
<script
crossorigin
src="https://unpkg.com/react-plotly.js@1.0.2/dist/create-plotly-component.js"
></script>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is included in our node_modules, we shouldn't need this script.

Comment on lines -59 to -68
<script>
const currentStack = JSON.parse(
window.localStorage.getItem('SynapseReactClientStyleGuideStack') ?? 'null',
)
if (currentStack) {
window.SRC = {
OVERRIDE_ENDPOINT_CONFIG: currentStack,
}
}
</script>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was replaced by Storybook controls long ago

@nickgros nickgros force-pushed the stabilize-chromatic-1 branch from 21f03c7 to 360588f Compare May 23, 2023 18:08
@@ -17,6 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v3.1.0
with:
ref: ${{ github.event.pull_request.head.ref }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy the pull request, not the main branch

Comment on lines +123 to +125
if (isChromatic && document.fonts) {
loaders.push(fontLoader)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When deployed to Chromatic, wait for the font to load before rendering the story. This should make our screenshots more stable

args: {
sql: 'SELECT funderName as "Funding Agency" FROM syn26344829',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This table has been deleted and the fallback is a skeleton with a random length. Update the story with a different table.

@jay-hodgson jay-hodgson self-requested a review May 23, 2023 21:22
@nickgros nickgros merged commit dfe07b8 into Sage-Bionetworks:main May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants