-
Notifications
You must be signed in to change notification settings - Fork 23
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
Changes from all commits
9bd666d
727a46e
f01c128
8efc248
f6b66b2
360588f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<script> | ||
window.global = window | ||
window.sql = {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no longer needed since we removed the |
||
</script> | ||
|
||
<link | ||
|
@@ -51,18 +50,3 @@ | |
<script src="https://cdn.jsdelivr.net/npm/markdown-it-container@2.0.0/dist/markdown-it-container.min.js"></script> | ||
<!-- end synapse markdown imports --> | ||
<script crossorigin src="https://cdn.plot.ly/plotly-latest.min.js"></script> | ||
<script | ||
crossorigin | ||
src="https://unpkg.com/react-plotly.js@1.0.2/dist/create-plotly-component.js" | ||
></script> | ||
|
||
Comment on lines
-54
to
-58
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
<script> | ||
const currentStack = JSON.parse( | ||
window.localStorage.getItem('SynapseReactClientStyleGuideStack') ?? 'null', | ||
) | ||
if (currentStack) { | ||
window.SRC = { | ||
OVERRIDE_ENDPOINT_CONFIG: currentStack, | ||
} | ||
} | ||
</script> | ||
Comment on lines
-59
to
-68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was replaced by Storybook controls long ago |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import { StorybookComponentWrapper } from '../src/components/StorybookComponentW | |
import { initialize, mswLoader } from 'msw-storybook-addon' | ||
import { getHandlers } from '../mocks/msw/handlers' | ||
import { MOCK_REPO_ORIGIN } from '../src/utils/functions/getEndpoint' | ||
import isChromatic from 'chromatic/isChromatic' | ||
|
||
globalThis.Buffer = Buffer | ||
globalThis.process = { | ||
|
@@ -113,8 +114,16 @@ initialize({ | |
}, | ||
}) | ||
|
||
const fontLoader = async () => ({ | ||
fonts: await Promise.all([document.fonts.load('700 1em Lato')]), | ||
}) | ||
|
||
export const loaders = [mswLoader] | ||
|
||
if (isChromatic && document.fonts) { | ||
loaders.push(fontLoader) | ||
} | ||
Comment on lines
+123
to
+125
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
||
export const decorators = [ | ||
(Story, context) => { | ||
return ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,12 @@ export default meta | |
type Story = StoryObj<typeof meta> | ||
|
||
export const Demo: Story = { | ||
name: 'SubsectionRowRenderer', | ||
args: { | ||
sql: 'SELECT funderName as "Funding Agency" FROM syn26344829', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
searchParams: { Resource_id: '844b598c-0171-4972-91c3-27aa21b45d52' }, | ||
sql: 'SELECT abstract as "Summary" FROM syn21918972.488', | ||
searchParams: { | ||
grantNumber: 'CA217655', | ||
}, | ||
isMarkdown: false, | ||
}, | ||
} |
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.
Deploy the pull request, not the main branch