forked from owid/owid-grapher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stories.jsdom.test.tsx
executable file
·78 lines (74 loc) · 3.22 KB
/
stories.jsdom.test.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#! /usr/bin/env jest
import { configure, mount } from "enzyme"
import Adapter from "enzyme-adapter-react-16"
configure({ adapter: new Adapter() })
// This just does a sanity check that all the stories can mount.
// This file might not be necessary as there may be a way to do something similar with Storybook/Jest.
// For now, to get a list of all stories for updating this file:
// git ls-tree -r master --name-only | grep .stories.tsx | sed 's/.tsx//'
import * as StackedAreaChart from "./stackedCharts/StackedAreaChart.stories"
import * as DiscreteBarChart from "./barCharts/DiscreteBarChart.stories"
import * as CaptionedChart from "./captionedChart/CaptionedChart.stories"
import * as NoDataModal from "./noDataModal/NoDataModal.stories"
import * as CollapsibleList from "./controls/CollapsibleList/CollapsibleList.stories"
import * as CommandPalette from "./controls/CommandPalette.stories"
import * as EntityPicker from "./controls/entityPicker/EntityPicker.stories"
import * as ScaleSelector from "./controls/ScaleSelector.stories"
import * as GlobalEntitySelector from "./controls/globalEntitySelector/GlobalEntitySelector.stories"
import * as Grapher from "./core/Grapher.stories"
import * as DataTable from "./dataTable/DataTable.stories"
import * as FacetChart from "./facetChart/FacetChart.stories"
import * as Footer from "./footer/Footer.stories"
import * as Header from "./header/Header.stories"
import * as LineChart from "./lineCharts/LineChart.stories"
import * as LoadingIndicator from "./loadingIndicator/LoadingIndicator.stories"
import * as ScatterPlot from "./scatterCharts/ScatterPlotChart.stories"
import * as SlopeChart from "./slopeCharts/SlopeChart.stories"
import * as TimelineComponent from "./timeline/TimelineComponent.stories"
import * as StackedBarChart from "./stackedCharts/StackedBarChart.stories"
import * as DownloadTab from "./downloadTab/DownloadTab.stories"
import * as LineLegend from "./lineLegend/LineLegend.stories"
import * as MapChart from "./mapCharts/MapChart.stories"
import * as MapTooltip from "./mapCharts/MapTooltip.stories"
import * as Spreadsheet from "./spreadsheet/Spreadsheet.stories"
import * as SourcesTab from "./sourcesTab/SourcesTab.stories"
import * as VerticalColorLegend from "./verticalColorLegend/VerticalColorLegend.stories"
const runTests = (storybook: any) => {
const defaults = storybook.default
Object.keys(storybook).forEach((key) => {
if (key === "default") return
describe(defaults.title, () => {
const args = {}
it(`should load ${key}`, () => {
expect(mount(storybook[key](args))).toBeTruthy()
})
})
})
}
runTests(StackedAreaChart)
runTests(DiscreteBarChart)
runTests(CaptionedChart)
runTests(NoDataModal)
runTests(CollapsibleList)
runTests(CommandPalette)
runTests(EntityPicker)
runTests(ScaleSelector)
runTests(Grapher)
runTests(DataTable)
runTests(FacetChart)
runTests(Footer)
runTests(Header)
runTests(LineChart)
runTests(LoadingIndicator)
runTests(ScatterPlot)
runTests(SlopeChart)
runTests(TimelineComponent)
runTests(StackedBarChart)
runTests(DownloadTab)
runTests(LineLegend)
runTests(MapChart)
runTests(MapTooltip)
runTests(SourcesTab)
runTests(GlobalEntitySelector)
runTests(Spreadsheet)
runTests(VerticalColorLegend)