@synerise/ds-mocks 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/Button/index.js +5 -1
- package/dist/Button/jest.d.ts +1 -1
- package/dist/Button/jest.js +25 -36
- package/dist/Button/vi.d.ts +3 -4
- package/dist/Button/vi.js +19 -50
- package/dist/Cruds/index.js +5 -1
- package/dist/Cruds/jest.d.ts +1 -1
- package/dist/Cruds/jest.js +33 -52
- package/dist/Cruds/vi.d.ts +3 -4
- package/dist/Cruds/vi.js +27 -66
- package/dist/Dropdown/index.js +5 -1
- package/dist/Dropdown/jest.d.ts +1 -1
- package/dist/Dropdown/jest.js +31 -38
- package/dist/Dropdown/vi.d.ts +3 -4
- package/dist/Dropdown/vi.js +25 -52
- package/dist/Form/index.js +5 -1
- package/dist/Form/jest.d.ts +2 -2
- package/dist/Form/jest.js +58 -75
- package/dist/Form/vi.d.ts +6 -16
- package/dist/Form/vi.js +56 -93
- package/dist/Icon/index.js +6 -1
- package/dist/Icon/jest.d.ts +1 -1
- package/dist/Icon/jest.js +34 -75
- package/dist/Icon/vi.d.ts +4 -5
- package/dist/Icon/vi.js +26 -69
- package/dist/Input/index.js +5 -1
- package/dist/Input/jest.d.ts +1 -1
- package/dist/Input/jest.js +35 -58
- package/dist/Input/vi.d.ts +5 -6
- package/dist/Input/vi.js +29 -72
- package/dist/Modal/index.js +5 -1
- package/dist/Modal/jest.d.ts +1 -1
- package/dist/Modal/jest.js +52 -66
- package/dist/Modal/vi.d.ts +3 -4
- package/dist/Modal/vi.js +46 -80
- package/dist/Scrollbar/index.js +4 -1
- package/dist/Scrollbar/vi.d.ts +1 -1
- package/dist/Scrollbar/vi.js +10 -22
- package/dist/Select/index.js +5 -1
- package/dist/Select/jest.d.ts +1 -1
- package/dist/Select/jest.js +48 -66
- package/dist/Select/vi.d.ts +5 -9
- package/dist/Select/vi.js +42 -80
- package/dist/Table/index.js +5 -1
- package/dist/Table/jest.d.ts +1 -1
- package/dist/Table/jest.js +85 -105
- package/dist/Table/vi.d.ts +3 -4
- package/dist/Table/vi.js +79 -120
- package/dist/Tabs/index.js +5 -1
- package/dist/Tabs/jest.d.ts +1 -1
- package/dist/Tabs/jest.js +29 -45
- package/dist/Tabs/vi.d.ts +3 -4
- package/dist/Tabs/vi.js +23 -59
- package/dist/Tooltip/index.js +5 -1
- package/dist/Tooltip/jest.d.ts +1 -1
- package/dist/Tooltip/jest.js +33 -39
- package/dist/Tooltip/vi.d.ts +3 -4
- package/dist/Tooltip/vi.js +27 -55
- package/dist/index.js +40 -14
- package/dist/jest.js +36 -11
- package/package.json +119 -119
package/dist/Select/jest.js
CHANGED
|
@@ -1,68 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
jest.mock(
|
|
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
|
-
onSelect == null || onSelect(e.target.value, {
|
|
30
|
-
value: e.target.value,
|
|
31
|
-
label: e.target.value
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
disabled: disabled
|
|
35
|
-
}, placeholder && /*#__PURE__*/React.createElement("option", {
|
|
36
|
-
value: ""
|
|
37
|
-
}, placeholder), options == null ? void 0 : options.map(
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
const mockSelect = () => {
|
|
3
|
+
jest.mock("@synerise/ds-select", () => ({
|
|
4
|
+
__esModule: true,
|
|
5
|
+
default: jest.fn(({
|
|
6
|
+
value,
|
|
7
|
+
defaultValue,
|
|
8
|
+
onChange,
|
|
9
|
+
onSelect,
|
|
10
|
+
placeholder,
|
|
11
|
+
disabled,
|
|
12
|
+
error,
|
|
13
|
+
options,
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
"data-testid": dataTestId
|
|
17
|
+
}) => /* @__PURE__ */ jsxs("select", { className: `ds-select ${className || ""}`, "data-testid": dataTestId || "ds-select", "data-error": error, value, defaultValue, onChange: (e) => {
|
|
18
|
+
onChange?.(e.target.value, {
|
|
19
|
+
value: e.target.value,
|
|
20
|
+
label: e.target.value
|
|
21
|
+
});
|
|
22
|
+
onSelect?.(e.target.value, {
|
|
23
|
+
value: e.target.value,
|
|
24
|
+
label: e.target.value
|
|
25
|
+
});
|
|
26
|
+
}, disabled, children: [
|
|
27
|
+
placeholder && /* @__PURE__ */ jsx("option", { value: "", children: placeholder }),
|
|
28
|
+
options?.map(
|
|
38
29
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
});
|
|
30
|
+
(opt, idx) => /* @__PURE__ */ jsx("option", { value: String(opt.value), children: opt.label }, idx)
|
|
31
|
+
),
|
|
32
|
+
children
|
|
33
|
+
] })),
|
|
34
|
+
Option: jest.fn(({
|
|
35
|
+
value,
|
|
36
|
+
children
|
|
37
|
+
}) => /* @__PURE__ */ jsx("option", { value: String(value), children }))
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
const mockSelectMinimal = () => {
|
|
41
|
+
jest.mock("@synerise/ds-select", () => ({
|
|
42
|
+
__esModule: true,
|
|
43
|
+
default: jest.fn(() => null),
|
|
44
|
+
Option: jest.fn(() => null)
|
|
45
|
+
}));
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
mockSelect,
|
|
49
|
+
mockSelectMinimal
|
|
55
50
|
};
|
|
56
|
-
export var mockSelectMinimal = function mockSelectMinimal() {
|
|
57
|
-
jest.mock('@synerise/ds-select', function () {
|
|
58
|
-
return {
|
|
59
|
-
__esModule: true,
|
|
60
|
-
"default": jest.fn(function () {
|
|
61
|
-
return null;
|
|
62
|
-
}),
|
|
63
|
-
Option: jest.fn(function () {
|
|
64
|
-
return null;
|
|
65
|
-
})
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
};
|
package/dist/Select/vi.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { SelectProps } from '@synerise/ds-select';
|
|
1
|
+
import { SelectProps } from '@synerise/ds-select';
|
|
3
2
|
export type MockSelectProps = SelectProps & {
|
|
4
3
|
'data-testid'?: string;
|
|
5
4
|
};
|
|
@@ -15,11 +14,8 @@ export type MockSelectProps = SelectProps & {
|
|
|
15
14
|
* ```
|
|
16
15
|
*/
|
|
17
16
|
export declare const selectMockFactory: () => {
|
|
18
|
-
default:
|
|
19
|
-
Option:
|
|
20
|
-
value: unknown;
|
|
21
|
-
children: ReactNode;
|
|
22
|
-
}) => React.JSX.Element>;
|
|
17
|
+
default: any;
|
|
18
|
+
Option: any;
|
|
23
19
|
};
|
|
24
20
|
/**
|
|
25
21
|
* Factory function for minimal Select mock.
|
|
@@ -30,6 +26,6 @@ export declare const selectMockFactory: () => {
|
|
|
30
26
|
* ```
|
|
31
27
|
*/
|
|
32
28
|
export declare const selectMinimalMockFactory: () => {
|
|
33
|
-
default:
|
|
34
|
-
Option:
|
|
29
|
+
default: any;
|
|
30
|
+
Option: any;
|
|
35
31
|
};
|
package/dist/Select/vi.js
CHANGED
|
@@ -1,82 +1,44 @@
|
|
|
1
|
-
import
|
|
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
|
-
return /*#__PURE__*/React.createElement("select", {
|
|
28
|
-
className: "ds-select " + (className || ''),
|
|
29
|
-
"data-testid": dataTestId || 'ds-select',
|
|
30
|
-
"data-error": error,
|
|
31
|
-
value: value,
|
|
32
|
-
defaultValue: defaultValue,
|
|
33
|
-
onChange: function onChange(e) {
|
|
34
|
-
_onChange == null || _onChange(e.target.value, {
|
|
35
|
-
value: e.target.value,
|
|
36
|
-
label: e.target.value
|
|
37
|
-
});
|
|
38
|
-
onSelect == null || onSelect(e.target.value, {
|
|
39
|
-
value: e.target.value,
|
|
40
|
-
label: e.target.value
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
disabled: disabled
|
|
44
|
-
}, placeholder && /*#__PURE__*/React.createElement("option", {
|
|
45
|
-
value: ""
|
|
46
|
-
}, placeholder), options == null ? void 0 : options.map(
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
const selectMockFactory = () => ({
|
|
3
|
+
default: vi.fn(({
|
|
4
|
+
value,
|
|
5
|
+
defaultValue,
|
|
6
|
+
onChange,
|
|
7
|
+
onSelect,
|
|
8
|
+
placeholder,
|
|
9
|
+
disabled,
|
|
10
|
+
error,
|
|
11
|
+
options,
|
|
12
|
+
children,
|
|
13
|
+
className,
|
|
14
|
+
"data-testid": dataTestId
|
|
15
|
+
}) => /* @__PURE__ */ jsxs("select", { className: `ds-select ${className || ""}`, "data-testid": dataTestId || "ds-select", "data-error": error, value, defaultValue, onChange: (e) => {
|
|
16
|
+
onChange?.(e.target.value, {
|
|
17
|
+
value: e.target.value,
|
|
18
|
+
label: e.target.value
|
|
19
|
+
});
|
|
20
|
+
onSelect?.(e.target.value, {
|
|
21
|
+
value: e.target.value,
|
|
22
|
+
label: e.target.value
|
|
23
|
+
});
|
|
24
|
+
}, disabled, children: [
|
|
25
|
+
placeholder && /* @__PURE__ */ jsx("option", { value: "", children: placeholder }),
|
|
26
|
+
options?.map(
|
|
47
27
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
28
|
+
(opt, idx) => /* @__PURE__ */ jsx("option", { value: String(opt.value), children: opt.label }, idx)
|
|
29
|
+
),
|
|
30
|
+
children
|
|
31
|
+
] })),
|
|
32
|
+
Option: vi.fn(({
|
|
33
|
+
value,
|
|
34
|
+
children
|
|
35
|
+
}) => /* @__PURE__ */ jsx("option", { value: String(value), children }))
|
|
36
|
+
});
|
|
37
|
+
const selectMinimalMockFactory = () => ({
|
|
38
|
+
default: vi.fn(() => null),
|
|
39
|
+
Option: vi.fn(() => null)
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
selectMinimalMockFactory,
|
|
43
|
+
selectMockFactory
|
|
63
44
|
};
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Factory function for minimal Select mock.
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```typescript
|
|
70
|
-
* vi.mock('@synerise/ds-select', selectMinimalMockFactory);
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
|
-
export var selectMinimalMockFactory = function selectMinimalMockFactory() {
|
|
74
|
-
return {
|
|
75
|
-
"default": vi.fn(function () {
|
|
76
|
-
return null;
|
|
77
|
-
}),
|
|
78
|
-
Option: vi.fn(function () {
|
|
79
|
-
return null;
|
|
80
|
-
})
|
|
81
|
-
};
|
|
82
|
-
};
|
package/dist/Table/index.js
CHANGED
package/dist/Table/jest.d.ts
CHANGED
package/dist/Table/jest.js
CHANGED
|
@@ -1,111 +1,91 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
const getDataIndex = (dataIndex) => {
|
|
3
3
|
if (Array.isArray(dataIndex)) {
|
|
4
|
-
return dataIndex.join(
|
|
4
|
+
return dataIndex.join(".");
|
|
5
5
|
}
|
|
6
|
-
return String(dataIndex
|
|
6
|
+
return String(dataIndex ?? "");
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
jest.mock(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
className: "ds-table",
|
|
47
|
-
"data-loading": loading
|
|
48
|
-
}, title && /*#__PURE__*/React.createElement("div", {
|
|
49
|
-
"data-testid": testId + "-title"
|
|
50
|
-
}, renderTitle(title)), loading ? /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
"data-testid": testId + "-loading"
|
|
52
|
-
}, "Loading...") : /*#__PURE__*/React.createElement("table", null, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", {
|
|
53
|
-
"data-testid": testId + "-header"
|
|
54
|
-
}, rowSelection && /*#__PURE__*/React.createElement("th", null, "Select"), columns.map(
|
|
55
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
56
|
-
function (col, idx) {
|
|
57
|
-
return /*#__PURE__*/React.createElement("th", {
|
|
58
|
-
key: col.key || idx,
|
|
59
|
-
"data-testid": testId + "-header-" + (getDataIndex(col.dataIndex) || idx)
|
|
60
|
-
}, renderColumnTitle(col.title));
|
|
61
|
-
}))), /*#__PURE__*/React.createElement("tbody", null, dataSource.map(
|
|
62
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
63
|
-
function (record, rowIndex) {
|
|
64
|
-
var _rowSelection$selecte;
|
|
65
|
-
var key = getRowKey(record, rowIndex);
|
|
66
|
-
var rowProps = onRow == null ? void 0 : onRow(record, rowIndex);
|
|
67
|
-
return /*#__PURE__*/React.createElement("tr", {
|
|
68
|
-
key: key,
|
|
69
|
-
"data-testid": testId + "-row-" + rowIndex,
|
|
70
|
-
onClick: rowProps == null ? void 0 : rowProps.onClick
|
|
71
|
-
}, rowSelection && /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("input", {
|
|
72
|
-
type: "checkbox",
|
|
73
|
-
"data-testid": testId + "-checkbox-" + rowIndex,
|
|
74
|
-
checked: (_rowSelection$selecte = rowSelection.selectedRowKeys) == null ? void 0 : _rowSelection$selecte.includes(key),
|
|
75
|
-
onChange: function onChange() {
|
|
76
|
-
var _rowSelection$selecte2;
|
|
77
|
-
var newKeys = (_rowSelection$selecte2 = rowSelection.selectedRowKeys) != null && _rowSelection$selecte2.includes(key) ? rowSelection.selectedRowKeys.filter(
|
|
8
|
+
const mockTable = () => {
|
|
9
|
+
jest.mock("@synerise/ds-table", () => ({
|
|
10
|
+
__esModule: true,
|
|
11
|
+
default: jest.fn(({
|
|
12
|
+
dataSource = [],
|
|
13
|
+
columns = [],
|
|
14
|
+
loading,
|
|
15
|
+
rowKey = "key",
|
|
16
|
+
onRow,
|
|
17
|
+
rowSelection,
|
|
18
|
+
title,
|
|
19
|
+
"data-testid": dataTestId
|
|
20
|
+
}) => {
|
|
21
|
+
const testId = dataTestId || "ds-table";
|
|
22
|
+
const getRowKey = (record, index) => {
|
|
23
|
+
if (typeof rowKey === "function") {
|
|
24
|
+
return rowKey(record);
|
|
25
|
+
}
|
|
26
|
+
return String(record[rowKey] ?? index);
|
|
27
|
+
};
|
|
28
|
+
const renderTitle = (t) => {
|
|
29
|
+
if (typeof t === "function") {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return t;
|
|
33
|
+
};
|
|
34
|
+
const renderColumnTitle = (colTitle) => {
|
|
35
|
+
if (typeof colTitle === "function") {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return colTitle;
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ jsxs("div", { "data-testid": testId, className: "ds-table", "data-loading": loading, children: [
|
|
41
|
+
title && /* @__PURE__ */ jsx("div", { "data-testid": `${testId}-title`, children: renderTitle(title) }),
|
|
42
|
+
loading ? /* @__PURE__ */ jsx("div", { "data-testid": `${testId}-loading`, children: "Loading..." }) : /* @__PURE__ */ jsxs("table", { children: [
|
|
43
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { "data-testid": `${testId}-header`, children: [
|
|
44
|
+
rowSelection && /* @__PURE__ */ jsx("th", { children: "Select" }),
|
|
45
|
+
columns.map(
|
|
78
46
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
47
|
+
(col, idx) => /* @__PURE__ */ jsx("th", { "data-testid": `${testId}-header-${getDataIndex(col.dataIndex) || idx}`, children: renderColumnTitle(col.title) }, col.key || idx)
|
|
48
|
+
)
|
|
49
|
+
] }) }),
|
|
50
|
+
/* @__PURE__ */ jsx("tbody", { children: dataSource.map(
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
|
+
(record, rowIndex) => {
|
|
53
|
+
const key = getRowKey(record, rowIndex);
|
|
54
|
+
const rowProps = onRow?.(record, rowIndex);
|
|
55
|
+
return /* @__PURE__ */ jsxs("tr", { "data-testid": `${testId}-row-${rowIndex}`, onClick: rowProps?.onClick, children: [
|
|
56
|
+
rowSelection && /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("input", { type: "checkbox", "data-testid": `${testId}-checkbox-${rowIndex}`, checked: rowSelection.selectedRowKeys?.includes(key), onChange: () => {
|
|
57
|
+
const newKeys = rowSelection.selectedRowKeys?.includes(key) ? rowSelection.selectedRowKeys.filter(
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
59
|
+
(k) => k !== key
|
|
60
|
+
) : [...rowSelection.selectedRowKeys || [], key];
|
|
61
|
+
rowSelection.onChange?.(newKeys, [], {
|
|
62
|
+
type: "all"
|
|
63
|
+
});
|
|
64
|
+
} }) }),
|
|
65
|
+
columns.map(
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
67
|
+
(col, colIndex) => {
|
|
68
|
+
const dataIdx = getDataIndex(col.dataIndex);
|
|
69
|
+
const cellValue = record[dataIdx];
|
|
70
|
+
const rendered = col.render ? col.render(cellValue, record, rowIndex) : cellValue;
|
|
71
|
+
return /* @__PURE__ */ jsx("td", { "data-testid": `${testId}-cell-${rowIndex}-${colIndex}`, children: String(rendered ?? "") }, col.key || colIndex);
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
] }, key);
|
|
85
75
|
}
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
76
|
+
) })
|
|
77
|
+
] })
|
|
78
|
+
] });
|
|
79
|
+
})
|
|
80
|
+
}));
|
|
81
|
+
};
|
|
82
|
+
const mockTableMinimal = () => {
|
|
83
|
+
jest.mock("@synerise/ds-table", () => ({
|
|
84
|
+
__esModule: true,
|
|
85
|
+
default: jest.fn(() => null)
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
mockTable,
|
|
90
|
+
mockTableMinimal
|
|
101
91
|
};
|
|
102
|
-
export var mockTableMinimal = function mockTableMinimal() {
|
|
103
|
-
jest.mock('@synerise/ds-table', function () {
|
|
104
|
-
return {
|
|
105
|
-
__esModule: true,
|
|
106
|
-
"default": jest.fn(function () {
|
|
107
|
-
return null;
|
|
108
|
-
})
|
|
109
|
-
};
|
|
110
|
-
});
|
|
111
|
-
};
|
package/dist/Table/vi.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { DSTableProps } from '@synerise/ds-table';
|
|
1
|
+
import { DSTableProps } from '@synerise/ds-table';
|
|
3
2
|
export type MockTableProps = DSTableProps<Record<string, unknown>> & {
|
|
4
3
|
'data-testid'?: string;
|
|
5
4
|
};
|
|
@@ -15,7 +14,7 @@ export type MockTableProps = DSTableProps<Record<string, unknown>> & {
|
|
|
15
14
|
* ```
|
|
16
15
|
*/
|
|
17
16
|
export declare const tableMockFactory: () => {
|
|
18
|
-
default:
|
|
17
|
+
default: any;
|
|
19
18
|
};
|
|
20
19
|
/**
|
|
21
20
|
* Factory function for minimal Table mock.
|
|
@@ -26,5 +25,5 @@ export declare const tableMockFactory: () => {
|
|
|
26
25
|
* ```
|
|
27
26
|
*/
|
|
28
27
|
export declare const tableMinimalMockFactory: () => {
|
|
29
|
-
default:
|
|
28
|
+
default: any;
|
|
30
29
|
};
|