Remove last storybook/addon-knobs reference (#40498)

* Remove last storybook/addon-knobs reference

* Fix issue with infinite recursion in story

* Remove failing snapshot

Co-authored-by: Laura Hacker <laura.hacker@sourcegraph.com>
This commit is contained in:
Petri-Johan Last 2022-08-17 20:14:19 +01:00 committed by GitHub
parent 92c011f5dd
commit c80ec5787f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 80 deletions

View File

@ -432,82 +432,6 @@ exports[`StreamingProgressSkippedPopover should render correctly 1`] = `
)
</label>
</div>
<div
class="form-check mb-1 d-block"
>
<input
class="form-check-input"
data-testid="streaming-progress-skipped-suggest-check-3"
id="streaming-progress-skipped-suggest-check-3"
label="[object Object]"
type="checkbox"
value="archived:yes"
/>
<label
class="label form-check-label label"
for="streaming-progress-skipped-suggest-check-3"
>
archived:yes (
<span
class="text-monospace search-query-link"
>
<span
class="search-filter-keyword"
>
archived
</span>
<span
class="search-filter-separator"
>
:
</span>
<span
class="search-query-text"
>
yes
</span>
</span>
)
</label>
</div>
<div
class="form-check mb-1 d-block"
>
<input
class="form-check-input"
data-testid="streaming-progress-skipped-suggest-check-3"
id="streaming-progress-skipped-suggest-check-3"
label="[object Object]"
type="checkbox"
value="archived:yes"
/>
<label
class="label form-check-label label"
for="streaming-progress-skipped-suggest-check-3"
>
archived:yes (
<span
class="text-monospace search-query-link"
>
<span
class="search-filter-keyword"
>
archived
</span>
<span
class="search-filter-separator"
>
:
</span>
<span
class="search-query-text"
>
yes
</span>
</span>
)
</label>
</div>
<div
class="form-check mb-1 d-block"
>

View File

@ -38,6 +38,9 @@ export const parameters: Parameters = {
},
// disables snapshotting for all stories by default
chromatic: { disableSnapshot: true },
// This fixes an issue where some stories with knobs wound up in a state of infinite recursion
// See https://github.com/storybookjs/storybook/issues/15051
docs: { source: { type: 'code' } },
}
configureActions({ depth: 100, limit: 20 })

View File

@ -1,4 +1,3 @@
import { boolean } from '@storybook/addon-knobs'
import { Meta, Story } from '@storybook/react'
import { AxisScale } from '@visx/axis/lib/types'
import { ParentSize } from '@visx/responsive'
@ -17,6 +16,12 @@ const StoryConfig: Meta = {
<BrandedStory styles={webStyles}>{() => <div className="container mt-3">{story()}</div>}</BrandedStory>
),
],
argTypes: {
useMaxValuesForYScale: {
type: 'boolean',
defaultValue: false,
},
},
parameters: { chromatic: { disableSnapshots: false } },
}
@ -45,7 +50,7 @@ const SimpleChartTemplate: Story<TemplateProps> = args => (
</ParentSize>
)
export const SmartAxisDemo: Story = () => (
export const SmartAxisDemo: Story = args => (
<section style={{ display: 'flex', flexWrap: 'wrap', gap: 20 }}>
<SimpleChartTemplate
xScale={scaleTime<number>({
@ -54,7 +59,7 @@ export const SmartAxisDemo: Story = () => (
clamp: true,
})}
yScale={scaleLinear({
domain: [0, boolean('useMaxValuesForYScale', false) ? 1000000000000000000000000000000000000 : 10000],
domain: [0, args.useMaxValuesForYScale ? 1000000000000000000000000000000000000 : 10000],
nice: true,
clamp: true,
})}
@ -69,7 +74,7 @@ export const SmartAxisDemo: Story = () => (
padding: 0.2,
})}
yScale={scaleLinear({
domain: [0, boolean('useMaxValuesForYScale', false) ? 1000000000000000000000000000000000000 : 10000],
domain: [0, args.useMaxValuesForYScale ? 1000000000000000000000000000000000000 : 10000],
nice: true,
clamp: true,
})}