Skip to content

Commit 9a343ee

Browse files
committed
[tests] Snapshots
1 parent 767fb71 commit 9a343ee

4 files changed

Lines changed: 103 additions & 70 deletions

File tree

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
"lcov",
114114
"libsql",
115115
"linebreak",
116+
"linechart",
116117
"lluc",
117118
"Lumet",
118119
"marksteve",

test/unit/core/types/__snapshots__/types.test.tsx.snap

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3024,23 +3024,33 @@ exports[`Types in ui-react-dom.tsx > 166:46 1`] = `"Type '"c2"' is not assignabl
30243024
30253025
exports[`Types in ui-react-dom.tsx > 171:23 1`] = `"Type '"v2"' is not assignable to type '"v1" | "v1d"'."`;
30263026
3027-
exports[`Types in ui-react-dom-charts.tsx > 29:5 1`] = `"Type '{ tableId: string; queryId: string; xCellId: string; yCellId: string; }' is not assignable to type 'IntrinsicAttributes & ((ChartTableSourceProps | ChartQuerySourceProps) & ChartBindingProps & ChartProps)'."`;
3027+
exports[`Types in ui-react-dom-charts.tsx > 25:23 1`] = `"Argument of type '{ tableId: "t1"; xCellId: "c1"; yCellId: "c1d"; sortCellId: "c0"; }' is not assignable to parameter of type '((({ readonly tableId: "t0"; readonly store?: StoreOrStoreId<[{ readonly t0: { readonly c0: { readonly type: "number"; }; }; readonly t1: { readonly c1: { readonly type: "number"; }; readonly c1d: { readonly type: "string"; readonly default: ""; }; }; }, { ...; }]> | undefined; readonly queryId?: undefined; readonly...'."`;
30283028
3029-
exports[`Types in ui-react-dom-charts.tsx > 30:5 1`] = `"Type '{ queryId: string; tableId: string; xCellId: string; yCellId: string; }' is not assignable to type 'IntrinsicAttributes & ((ChartTableSourceProps | ChartQuerySourceProps) & ChartBindingProps & ChartProps)'."`;
3029+
exports[`Types in ui-react-dom-charts.tsx > 32:22 1`] = `"Argument of type '{ tableId: "t1"; queryId: string; xCellId: "c1"; yCellId: "c1d"; }' is not assignable to parameter of type '((({ readonly tableId: "t0"; readonly store?: StoreOrStoreId<[{ readonly t0: { readonly c0: { readonly type: "number"; }; }; readonly t1: { readonly c1: { readonly type: "number"; }; readonly c1d: { readonly type: "string"; readonly default: ""; }; }; }, { ...; }]> | undefined; readonly queryId?: undefined; readonly...'."`;
30303030
3031-
exports[`Types in ui-react-dom-charts.tsx > 47:26 1`] = `"Type '"t2"' is not assignable to type '"t0" | "t1" | undefined'."`;
3031+
exports[`Types in ui-react-dom-charts.tsx > 40:4 1`] = `"Type 'string' is not assignable to type '"t0" | "t1" | undefined'."`;
30323032
3033-
exports[`Types in ui-react-dom-charts.tsx > 48:5 1`] = `"Type '{ tableId: "t1"; xCellId: "c2"; yCellId: "c1"; }' is not assignable to type 'IntrinsicAttributes & (((({ readonly tableId: "t0"; readonly store?: StoreOrStoreId<[{ readonly t0: { readonly c0: { readonly type: "number"; }; }; readonly t1: { readonly c1: { readonly type: "number"; }; readonly c1d: { ...; }; }; }, { ...; }]> | undefined; readonly queryId?: undefined; readonly queries?: undefine...'."`;
3033+
exports[`Types in ui-react-dom-charts.tsx > 50:7 1`] = `"Type '{ className: string; tableId: string; queryId: string; xCellId: string; yCellId: string; }' is not assignable to type 'IntrinsicAttributes & ((ChartTableSourceProps | ChartQuerySourceProps) & ChartBindingProps & ChartProps)'."`;
30343034
3035-
exports[`Types in ui-react-dom-charts.tsx > 49:5 1`] = `"Type '{ tableId: "t1"; xCellId: "c0"; yCellId: "c1"; }' is not assignable to type 'IntrinsicAttributes & (((({ readonly tableId: "t0"; readonly store?: StoreOrStoreId<[{ readonly t0: { readonly c0: { readonly type: "number"; }; }; readonly t1: { readonly c1: { readonly type: "number"; }; readonly c1d: { ...; }; }; }, { ...; }]> | undefined; readonly queryId?: undefined; readonly queries?: undefine...'."`;
3035+
exports[`Types in ui-react-dom-charts.tsx > 51:7 1`] = `"Type '{ className: string; tableId: string; queryId: string; xCellId: string; yCellId: string; }' is not assignable to type 'IntrinsicAttributes & ((ChartTableSourceProps | ChartQuerySourceProps) & ChartBindingProps & ChartProps)'."`;
30363036
3037-
exports[`Types in ui-react-dom-charts.tsx > 50:5 1`] = `"Type '{ tableId: "t1"; xCellId: "c1"; yCellId: "c0"; }' is not assignable to type 'IntrinsicAttributes & (((({ readonly tableId: "t0"; readonly store?: StoreOrStoreId<[{ readonly t0: { readonly c0: { readonly type: "number"; }; }; readonly t1: { readonly c1: { readonly type: "number"; }; readonly c1d: { ...; }; }; }, { ...; }]> | undefined; readonly queryId?: undefined; readonly queries?: undefine...'."`;
3037+
exports[`Types in ui-react-dom-charts.tsx > 52:7 1`] = `"Type '{ className: string; queryId: string; tableId: string; xCellId: string; yCellId: string; }' is not assignable to type 'IntrinsicAttributes & ((ChartTableSourceProps | ChartQuerySourceProps) & ChartBindingProps & ChartProps)'."`;
30383038
3039-
exports[`Types in ui-react-dom-charts.tsx > 51:5 1`] = `"Type '{ tableId: "t1"; xCellId: "c1"; yCellId: "c1d"; sortCellId: "c0"; }' is not assignable to type 'IntrinsicAttributes & (((({ readonly tableId: "t0"; readonly store?: StoreOrStoreId<[{ readonly t0: { readonly c0: { readonly type: "number"; }; }; readonly t1: { readonly c1: { readonly type: "number"; }; readonly c1d: { ...; }; }; }, { ...; }]> | undefined; readonly queryId?: undefined; readonly queries?: undefine...'."`;
3039+
exports[`Types in ui-react-dom-charts.tsx > 53:7 1`] = `"Type '{ className: string; queryId: string; tableId: string; xCellId: string; yCellId: string; }' is not assignable to type 'IntrinsicAttributes & ((ChartTableSourceProps | ChartQuerySourceProps) & ChartBindingProps & ChartProps)'."`;
30403040
3041-
exports[`Types in ui-react-dom-charts.tsx > 52:5 1`] = `"Type '{ tableId: "t1"; queryId: string; xCellId: "c1"; yCellId: "c1d"; }' is not assignable to type 'IntrinsicAttributes & (((({ readonly tableId: "t0"; readonly store?: StoreOrStoreId<[{ readonly t0: { readonly c0: { readonly type: "number"; }; }; readonly t1: { readonly c1: { readonly type: "number"; }; readonly c1d: { ...; }; }; }, { ...; }]> | undefined; readonly queryId?: undefined; readonly queries?: undefine...'."`;
3041+
exports[`Types in ui-react-dom-charts.tsx > 69:28 1`] = `"Type '"t2"' is not assignable to type '"t0" | "t1" | undefined'."`;
30423042
3043-
exports[`Types in ui-react-dom-charts.tsx > 53:38 1`] = `"Type 'string' is not assignable to type '"t0" | "t1" | undefined'."`;
3043+
exports[`Types in ui-react-dom-charts.tsx > 70:7 1`] = `"Type '{ tableId: "t1"; xCellId: "c2"; yCellId: "c1"; }' is not assignable to type 'IntrinsicAttributes & (((({ readonly tableId: "t0"; readonly store?: StoreOrStoreId<[{ readonly t0: { readonly c0: { readonly type: "number"; }; }; readonly t1: { readonly c1: { readonly type: "number"; }; readonly c1d: { ...; }; }; }, { ...; }]> | undefined; readonly queryId?: undefined; readonly queries?: undefine...'."`;
3044+
3045+
exports[`Types in ui-react-dom-charts.tsx > 71:7 1`] = `"Type '{ tableId: "t1"; xCellId: "c0"; yCellId: "c1"; }' is not assignable to type 'IntrinsicAttributes & (((({ readonly tableId: "t0"; readonly store?: StoreOrStoreId<[{ readonly t0: { readonly c0: { readonly type: "number"; }; }; readonly t1: { readonly c1: { readonly type: "number"; }; readonly c1d: { ...; }; }; }, { ...; }]> | undefined; readonly queryId?: undefined; readonly queries?: undefine...'."`;
3046+
3047+
exports[`Types in ui-react-dom-charts.tsx > 71:28 1`] = `"Type '"t2"' is not assignable to type '"t0" | "t1" | undefined'."`;
3048+
3049+
exports[`Types in ui-react-dom-charts.tsx > 72:7 1`] = `"Type '{ tableId: "t1"; xCellId: "c2"; yCellId: "c1"; }' is not assignable to type 'IntrinsicAttributes & (((({ readonly tableId: "t0"; readonly store?: StoreOrStoreId<[{ readonly t0: { readonly c0: { readonly type: "number"; }; }; readonly t1: { readonly c1: { readonly type: "number"; }; readonly c1d: { ...; }; }; }, { ...; }]> | undefined; readonly queryId?: undefined; readonly queries?: undefine...'."`;
3050+
3051+
exports[`Types in ui-react-dom-charts.tsx > 73:7 1`] = `"Type '{ tableId: "t1"; xCellId: "c0"; yCellId: "c1"; }' is not assignable to type 'IntrinsicAttributes & (((({ readonly tableId: "t0"; readonly store?: StoreOrStoreId<[{ readonly t0: { readonly c0: { readonly type: "number"; }; }; readonly t1: { readonly c1: { readonly type: "number"; }; readonly c1d: { ...; }; }; }, { ...; }]> | undefined; readonly queryId?: undefined; readonly queries?: undefine...'."`;
3052+
3053+
exports[`Types in ui-react-dom-charts.tsx > 74:7 1`] = `"Type '{ tableId: "t1"; xCellId: "c1"; yCellId: "c0"; }' is not assignable to type 'IntrinsicAttributes & (((({ readonly tableId: "t0"; readonly store?: StoreOrStoreId<[{ readonly t0: { readonly c0: { readonly type: "number"; }; }; readonly t1: { readonly c1: { readonly type: "number"; }; readonly c1d: { ...; }; }; }, { ...; }]> | undefined; readonly queryId?: undefined; readonly queries?: undefine...'."`;
30443054
30453055
exports[`Types in ui-react-inspector.tsx > 5:6 1`] = `"Cannot assign to 'position' because it is a read-only property."`;
30463056

test/unit/core/types/ui-react-dom-charts.tsx

Lines changed: 55 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,61 @@ const UiReactDomChartsWithSchemas =
1818
UiReactDomCharts as UiReactDomCharts.WithSchemas<
1919
[typeof _tablesSchema, typeof _valuesSchema]
2020
>;
21-
const {
22-
BarChart: BarChartWithSchemas,
23-
LineChart: LineChartWithSchemas,
24-
} = UiReactDomChartsWithSchemas;
21+
const {BarChart: BarChartWithSchemas, LineChart: LineChartWithSchemas} =
22+
UiReactDomChartsWithSchemas;
2523

26-
const _App = () => (
27-
<>
28-
<LineChart tableId="t1" xCellId="c1" yCellId="c1d" />
29-
<BarChart queryId="q1" xCellId="c1" yCellId="c1d" />
30-
<LineChart tableId="t1" queryId="q1" xCellId="c1" yCellId="c1d" /> {/* ! */}
31-
<BarChart queryId="q1" tableId="t1" xCellId="c1" yCellId="c1d" /> {/* ! */}
32-
{/*
24+
const _App = () => {
25+
// prettier-ignore
26+
LineChartWithSchemas({ // !
27+
tableId: 't1',
28+
xCellId: 'c1',
29+
yCellId: 'c1d',
30+
sortCellId: 'c0',
31+
});
32+
// prettier-ignore
33+
BarChartWithSchemas({ // !
34+
tableId: 't1',
35+
queryId: 'q1',
36+
xCellId: 'c1',
37+
yCellId: 'c1d',
38+
});
39+
BarChartWithSchemas({
40+
queryId: 'q1',
41+
tableId: 't1', // !
42+
xCellId: 'c1',
43+
yCellId: 'c1d',
44+
});
45+
46+
return (
47+
<>
48+
<LineChart tableId="t1" xCellId="c1" yCellId="c1d" />
49+
<BarChart queryId="q1" xCellId="c1" yCellId="c1d" />
50+
{/* eslint-disable max-len */}
51+
{/* prettier-ignore */}
52+
<LineChart className="// !" tableId="t1" queryId="q1" xCellId="c1" yCellId="c1d" />
53+
{/* prettier-ignore */}
54+
<BarChart className="// !" queryId="q1" tableId="t1" xCellId="c1" yCellId="c1d" />
55+
{/* eslint-enable max-len */}
56+
{/*
3357
3458
*/}
35-
<LineChartWithSchemas tableId="t1" xCellId="c1" yCellId="c1d" />
36-
<LineChartWithSchemas
37-
tableId="t1"
38-
xCellId="c1"
39-
yCellId="c1d"
40-
sortCellId="c1"
41-
descending={true}
42-
offset={1}
43-
limit={2}
44-
className="sales"
45-
/>
46-
<BarChartWithSchemas tableId="t0" xCellId="c0" yCellId="c0" />
47-
<BarChartWithSchemas queryId="q1" xCellId="c2" yCellId="c3" />
48-
<LineChartWithSchemas tableId="t2" xCellId="c1" yCellId="c1d" /> {/* ! */}
49-
<LineChartWithSchemas tableId="t1" xCellId="c2" yCellId="c1" /> {/* ! */}
50-
<LineChartWithSchemas tableId="t1" xCellId="c0" yCellId="c1" /> {/* ! */}
51-
<LineChartWithSchemas tableId="t1" xCellId="c1" yCellId="c0" /> {/* ! */}
52-
<LineChartWithSchemas tableId="t1" xCellId="c1" yCellId="c1d" sortCellId="c0" /> {/* ! */}
53-
<BarChartWithSchemas tableId="t1" queryId="q1" xCellId="c1" yCellId="c1d" /> {/* ! */}
54-
<BarChartWithSchemas queryId="q1" tableId="t1" xCellId="c1" yCellId="c1d" /> {/* ! */}
55-
</>
56-
);
59+
<LineChartWithSchemas tableId="t1" xCellId="c1" yCellId="c1d" />
60+
<LineChartWithSchemas
61+
tableId="t1"
62+
xCellId="c1"
63+
yCellId="c1d"
64+
sortCellId="c1"
65+
descending={true}
66+
offset={1}
67+
limit={2}
68+
className="sales"
69+
/>
70+
<BarChartWithSchemas tableId="t0" xCellId="c0" yCellId="c0" />
71+
<BarChartWithSchemas queryId="q1" xCellId="c2" yCellId="c3" />
72+
<LineChartWithSchemas tableId="t2" xCellId="c1" yCellId="c1d" /> {/* ! */}
73+
<LineChartWithSchemas tableId="t1" xCellId="c2" yCellId="c1" /> {/* ! */}
74+
<LineChartWithSchemas tableId="t1" xCellId="c0" yCellId="c1" /> {/* ! */}
75+
<LineChartWithSchemas tableId="t1" xCellId="c1" yCellId="c0" /> {/* ! */}
76+
</>
77+
);
78+
};

0 commit comments

Comments
 (0)