@popsure/dirty-swan 0.28.1 → 0.28.2

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.
Files changed (57) hide show
  1. package/dist/cjs/index.d.ts +1 -1
  2. package/dist/cjs/index.js +156 -149
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/lib/components/comparisonTable/components/TableButton/index.d.ts +7 -0
  5. package/dist/cjs/lib/components/comparisonTable/components/TableButton/index.test.d.ts +1 -0
  6. package/dist/cjs/lib/components/comparisonTable/components/TableRowHeader/index.d.ts +7 -5
  7. package/dist/cjs/lib/components/comparisonTable/components/TableRowHeader/index.test.d.ts +1 -0
  8. package/dist/cjs/lib/components/comparisonTable/index.d.ts +2 -1
  9. package/dist/cjs/lib/index.d.ts +2 -2
  10. package/dist/esm/{_commonjsHelpers-0f86abda.js → _commonjsHelpers-e7f67fd8.js} +2 -2
  11. package/dist/esm/_commonjsHelpers-e7f67fd8.js.map +1 -0
  12. package/dist/esm/components/autocompleteAddress/demo.js +2 -2
  13. package/dist/esm/components/autocompleteAddress/index.js +2 -2
  14. package/dist/esm/components/autocompleteAddress/index.test.js +3 -3
  15. package/dist/esm/components/comparisonTable/components/TableButton/index.js +15 -0
  16. package/dist/esm/components/comparisonTable/components/TableButton/index.js.map +1 -0
  17. package/dist/esm/components/comparisonTable/components/TableButton/index.test.js +37 -0
  18. package/dist/esm/components/comparisonTable/components/TableButton/index.test.js.map +1 -0
  19. package/dist/esm/components/comparisonTable/components/TableRowHeader/index.js +5 -9
  20. package/dist/esm/components/comparisonTable/components/TableRowHeader/index.js.map +1 -1
  21. package/dist/esm/components/comparisonTable/components/TableRowHeader/index.test.js +82 -0
  22. package/dist/esm/components/comparisonTable/components/TableRowHeader/index.test.js.map +1 -0
  23. package/dist/esm/components/comparisonTable/index.js +3 -2
  24. package/dist/esm/components/comparisonTable/index.js.map +1 -1
  25. package/dist/esm/components/dateSelector/index.js +1 -1
  26. package/dist/esm/components/input/currency/index.test.js +2 -2
  27. package/dist/esm/components/markdown/index.js +1 -1
  28. package/dist/esm/components/multiDropzone/index.test.js +5 -7405
  29. package/dist/esm/components/multiDropzone/index.test.js.map +1 -1
  30. package/dist/esm/components/segmentedControl/index.test.js +2 -2
  31. package/dist/esm/{customRender-39982d87.js → customRender-4157fcff.js} +2 -2
  32. package/dist/esm/{customRender-39982d87.js.map → customRender-4157fcff.js.map} +1 -1
  33. package/dist/esm/extend-expect-46bdce4a.js +7406 -0
  34. package/dist/esm/extend-expect-46bdce4a.js.map +1 -0
  35. package/dist/esm/{index-51913e93.js → index-1463d5e9.js} +2 -2
  36. package/dist/esm/{index-51913e93.js.map → index-1463d5e9.js.map} +1 -1
  37. package/dist/esm/index.d.ts +1 -1
  38. package/dist/esm/index.js +3 -2
  39. package/dist/esm/index.js.map +1 -1
  40. package/dist/esm/lib/components/comparisonTable/components/TableButton/index.d.ts +7 -0
  41. package/dist/esm/lib/components/comparisonTable/components/TableButton/index.test.d.ts +1 -0
  42. package/dist/esm/lib/components/comparisonTable/components/TableRowHeader/index.d.ts +7 -5
  43. package/dist/esm/lib/components/comparisonTable/components/TableRowHeader/index.test.d.ts +1 -0
  44. package/dist/esm/lib/components/comparisonTable/index.d.ts +2 -1
  45. package/dist/esm/lib/index.d.ts +2 -2
  46. package/dist/esm/util/testUtils/customRender.js +2 -2
  47. package/package.json +1 -1
  48. package/src/index.tsx +1 -0
  49. package/src/lib/components/comparisonTable/components/TableButton/index.test.tsx +28 -0
  50. package/src/lib/components/comparisonTable/components/TableButton/index.tsx +22 -0
  51. package/src/lib/components/comparisonTable/components/TableButton/style.module.scss +18 -0
  52. package/src/lib/components/comparisonTable/components/TableRowHeader/index.test.tsx +78 -0
  53. package/src/lib/components/comparisonTable/components/TableRowHeader/index.tsx +20 -25
  54. package/src/lib/components/comparisonTable/index.stories.mdx +13 -5
  55. package/src/lib/components/comparisonTable/index.tsx +2 -0
  56. package/src/lib/index.tsx +2 -0
  57. package/dist/esm/_commonjsHelpers-0f86abda.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface Props {
3
+ onClick: () => void;
4
+ className?: string;
5
+ }
6
+ declare const TableButton: React.FC<Props>;
7
+ export default TableButton;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -1,7 +1,9 @@
1
- declare const TableRowHeader: (props: {
1
+ interface TableRowHeaderProps {
2
2
  label: string;
3
- icon?: string | undefined;
4
- subtitle?: string | undefined;
5
- onClickInfo?: (() => void) | undefined;
6
- }) => JSX.Element;
3
+ icon?: string;
4
+ subtitle?: string;
5
+ onClickInfo?: () => void;
6
+ }
7
+ declare const TableRowHeader: ({ icon, label, subtitle, onClickInfo }: TableRowHeaderProps) => JSX.Element;
8
+ export type { TableRowHeaderProps };
7
9
  export default TableRowHeader;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import TableButton from './components/TableButton';
2
3
  import TableInfoButton from './components/TableInfoButton';
3
4
  import TableRating from './components/TableRating';
4
5
  import TableRowHeader from './components/TableRowHeader';
@@ -48,4 +49,4 @@ export interface ComparisonTableProps<T> {
48
49
  declare const ComparisonTable: <T extends {
49
50
  id: number;
50
51
  }>(props: ComparisonTableProps<T>) => JSX.Element;
51
- export { ComparisonTable, TableInfoButton, TableRating, TableRowHeader, TableTrueFalse, };
52
+ export { ComparisonTable, TableButton, TableInfoButton, TableRating, TableRowHeader, TableTrueFalse, };
@@ -12,10 +12,10 @@ import Button from './components/button';
12
12
  import AutoSuggestMultiSelect from './components/input/autoSuggestMultiSelect';
13
13
  import Chip from './components/chip';
14
14
  import AutoSuggestInput from './components/input/autoSuggestInput';
15
- import { ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableInfoButton, TableHeader } from './components/comparisonTable';
15
+ import { ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, TableHeader } from './components/comparisonTable';
16
16
  import SegmentedControl from './components/segmentedControl';
17
17
  import Markdown from './components/markdown';
18
18
  export type { FileType, MultiDropzoneProps, UploadedFile, UploadStatus };
19
- export { DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, DownloadButton, IbanInput, BottomModal, RegularModal, BottomOrRegularModal, CardWithTopLeftIcon, CardWithLeftIcon, CardWithTopIcon, InfoCard, CardButton, Button, CurrencyInput, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableInfoButton, SegmentedControl, Markdown, };
19
+ export { DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, DownloadButton, IbanInput, BottomModal, RegularModal, BottomOrRegularModal, CardWithTopLeftIcon, CardWithLeftIcon, CardWithTopIcon, InfoCard, CardButton, Button, CurrencyInput, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, SegmentedControl, Markdown, };
20
20
  export type { TableHeader };
21
21
  export type { DownloadStatus } from './models/download';
@@ -19,5 +19,5 @@ function getAugmentedNamespace(n) {
19
19
  return a;
20
20
  }
21
21
 
22
- export { getAugmentedNamespace as a, commonjsGlobal as c, getDefaultExportFromCjs as g };
23
- //# sourceMappingURL=_commonjsHelpers-0f86abda.js.map
22
+ export { getDefaultExportFromCjs as a, commonjsGlobal as c, getAugmentedNamespace as g };
23
+ //# sourceMappingURL=_commonjsHelpers-e7f67fd8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_commonjsHelpers-e7f67fd8.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,8 +3,8 @@ import { useState } from 'react';
3
3
  import AutoCompleteAddress from './index.js';
4
4
  import '../../tslib.es6-5bc94358.js';
5
5
  import '../../index-e9e37a34.js';
6
- import '../../index-51913e93.js';
7
- import '../../_commonjsHelpers-0f86abda.js';
6
+ import '../../index-1463d5e9.js';
7
+ import '../../_commonjsHelpers-e7f67fd8.js';
8
8
  import '../input/index.js';
9
9
  import '../../style-inject.es-1f59c1d0.js';
10
10
  import '../../v4-d2999257.js';
@@ -2,8 +2,8 @@ import { _ as __assign } from '../../tslib.es6-5bc94358.js';
2
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
3
  import { useState, useRef, useEffect, useCallback } from 'react';
4
4
  import { c as classnames } from '../../index-e9e37a34.js';
5
- import { l as lodash_debounce } from '../../index-51913e93.js';
6
- import { c as commonjsGlobal } from '../../_commonjsHelpers-0f86abda.js';
5
+ import { l as lodash_debounce } from '../../index-1463d5e9.js';
6
+ import { c as commonjsGlobal } from '../../_commonjsHelpers-e7f67fd8.js';
7
7
  import Input from '../input/index.js';
8
8
  import { s as styleInject } from '../../style-inject.es-1f59c1d0.js';
9
9
  import '../../v4-d2999257.js';
@@ -1,13 +1,13 @@
1
1
  import { b as __awaiter, c as __generator } from '../../tslib.es6-5bc94358.js';
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { c as customRender, f as fireEvent } from '../../customRender-39982d87.js';
3
+ import { c as customRender, f as fireEvent } from '../../customRender-4157fcff.js';
4
4
  import AutoCompleteAddress from './index.js';
5
5
  import 'react';
6
6
  import 'react-dom';
7
- import '../../_commonjsHelpers-0f86abda.js';
7
+ import '../../_commonjsHelpers-e7f67fd8.js';
8
8
  import 'react-dom/test-utils';
9
9
  import '../../index-e9e37a34.js';
10
- import '../../index-51913e93.js';
10
+ import '../../index-1463d5e9.js';
11
11
  import '../input/index.js';
12
12
  import '../../style-inject.es-1f59c1d0.js';
13
13
  import '../../v4-d2999257.js';
@@ -0,0 +1,15 @@
1
+ import { _ as __assign } from '../../../../tslib.es6-5bc94358.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { s as styleInject } from '../../../../style-inject.es-1f59c1d0.js';
4
+
5
+ var css_248z = ".style-module_button__2W-YC {\n background-color: transparent;\n border-bottom: 2px dashed #696970;\n color: #4c4c53;\n cursor: pointer;\n padding: 2px;\n transition: 0.3s ease;\n transition-property: color, border-color;\n}\n.style-module_button__2W-YC:hover, .style-module_button__2W-YC:focus {\n border-color: #8e8cee;\n color: #8e8cee;\n outline-color: #8e8cee;\n}";
6
+ var styles = {"button":"style-module_button__2W-YC"};
7
+ styleInject(css_248z);
8
+
9
+ var TableButton = function (_a) {
10
+ var children = _a.children, onClick = _a.onClick, _b = _a.className, className = _b === void 0 ? '' : _b;
11
+ return (jsx("button", __assign({ className: styles.button + " " + className, "data-testid": "ds-table-button", onClick: onClick }, { children: children }), void 0));
12
+ };
13
+
14
+ export default TableButton;
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableButton/index.tsx"],"sourcesContent":["import styles from './style.module.scss';\n\ninterface Props {\n onClick: () => void;\n className?: string;\n}\n\nconst TableButton: React.FC<Props> = ({\n children,\n onClick,\n className = '',\n}) => (\n <button\n className={`${styles.button} ${className}`}\n data-testid=\"ds-table-button\"\n onClick={onClick}\n >\n {children}\n </button>\n);\n\nexport default TableButton;\n"],"names":["_jsx"],"mappings":";;;;;;;;IAOM,WAAW,GAAoB,UAAC,EAIrC;QAHC,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA;IACV,QACJA,yBACE,SAAS,EAAK,MAAM,CAAC,MAAM,SAAI,SAAW,iBAC9B,iBAAiB,EAC7B,OAAO,EAAE,OAAO,gBAEf,QAAQ,YACF;AAPL;;;;"}
@@ -0,0 +1,37 @@
1
+ import { _ as __assign, b as __awaiter, c as __generator } from '../../../../tslib.es6-5bc94358.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { c as customRender } from '../../../../customRender-4157fcff.js';
4
+ import '../../../../extend-expect-46bdce4a.js';
5
+ import TableButton from './index.js';
6
+ import 'react';
7
+ import 'react-dom';
8
+ import '../../../../_commonjsHelpers-e7f67fd8.js';
9
+ import 'react-dom/test-utils';
10
+ import 'os';
11
+ import 'tty';
12
+ import '../../../../style-inject.es-1f59c1d0.js';
13
+
14
+ var mockOnClick = jest.fn();
15
+ var buttonContent = "Table Button label";
16
+ var setup = function () { return customRender(jsx(TableButton, __assign({ onClick: mockOnClick }, { children: buttonContent }), void 0)); };
17
+ describe('TableButton component', function () {
18
+ it("should render button content", function () {
19
+ var getByText = setup().getByText;
20
+ expect(getByText(buttonContent)).toBeInTheDocument();
21
+ });
22
+ it("should call onClick", function () { return __awaiter(void 0, void 0, void 0, function () {
23
+ var _a, getByText, user;
24
+ return __generator(this, function (_b) {
25
+ switch (_b.label) {
26
+ case 0:
27
+ _a = setup(), getByText = _a.getByText, user = _a.user;
28
+ return [4 /*yield*/, user.click(getByText(buttonContent))];
29
+ case 1:
30
+ _b.sent();
31
+ expect(mockOnClick).toHaveBeenCalled();
32
+ return [2 /*return*/];
33
+ }
34
+ });
35
+ }); });
36
+ });
37
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableButton/index.test.tsx"],"sourcesContent":["import { render } from '../../../../util/testUtils';\nimport '@testing-library/jest-dom';\n\nimport TableButton from '.';\n\nconst mockOnClick = jest.fn();\n\nconst buttonContent = \"Table Button label\";\n\nconst setup = () => render(\n <TableButton onClick={mockOnClick}>{buttonContent}</TableButton>\n);\n\ndescribe('TableButton component', () => {\n it(\"should render button content\", () => {\n const { getByText } = setup();\n\n expect(getByText(buttonContent)).toBeInTheDocument();\n });\n\n it(\"should call onClick\", async () => {\n const { getByText, user } = setup();\n\n await user.click(getByText(buttonContent));\n\n expect(mockOnClick).toHaveBeenCalled();\n });\n});\n"],"names":["render","_jsx"],"mappings":";;;;;;;;;;;;;AAKA,IAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAE9B,IAAM,aAAa,GAAG,oBAAoB,CAAC;AAE3C,IAAM,KAAK,GAAG,cAAM,OAAAA,YAAM,CACxBC,IAAC,WAAW,aAAC,OAAO,EAAE,WAAW,gBAAG,aAAa,YAAe,CACjE,GAAA,CAAC;AAEF,QAAQ,CAAC,uBAAuB,EAAE;IAChC,EAAE,CAAC,8BAA8B,EAAE;QACzB,IAAA,SAAS,GAAK,KAAK,EAAE,UAAZ,CAAa;QAE9B,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;KACtD,CAAC,CAAC;IAEH,EAAE,CAAC,qBAAqB,EAAE;;;;;oBAClB,KAAsB,KAAK,EAAE,EAA3B,SAAS,eAAA,EAAE,IAAI,UAAA,CAAa;oBAEpC,qBAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,EAAA;;oBAA1C,SAA0C,CAAC;oBAE3C,MAAM,CAAC,WAAW,CAAC,CAAC,gBAAgB,EAAE,CAAC;;;;SACxC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,20 +1,16 @@
1
1
  import { _ as __assign } from '../../../../tslib.es6-5bc94358.js';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { c as classnames } from '../../../../index-e9e37a34.js';
4
- import TableInfoButton from '../TableInfoButton/index.js';
3
+ import TableButton from '../TableButton/index.js';
5
4
  import { s as styleInject } from '../../../../style-inject.es-1f59c1d0.js';
6
5
 
7
6
  var css_248z = ".style-module_icon__30Nor {\n min-width: 20px;\n}";
8
7
  var styles = {"icon":"style-module_icon__30Nor"};
9
8
  styleInject(css_248z);
10
9
 
11
- var TableRowHeader = function (props) {
12
- var icon = props.icon, label = props.label, subtitle = props.subtitle, onClickInfo = props.onClickInfo;
13
- return (jsxs("div", __assign({ className: "d-flex" }, { children: [jsx("span", __assign({ className: "mr8 " + styles.icon }, { children: icon }), void 0),
14
- jsxs("div", { children: [jsxs("p", __assign({ className: "p-p d-inline" }, { children: [jsx("span", __assign({ className: classnames({
15
- mr8: onClickInfo,
16
- }) }, { children: label }), void 0),
17
- onClickInfo && jsx(TableInfoButton, { onClick: onClickInfo }, void 0)] }), void 0),
10
+ var TableRowHeader = function (_a) {
11
+ var icon = _a.icon, label = _a.label, subtitle = _a.subtitle, onClickInfo = _a.onClickInfo;
12
+ return (jsxs("div", __assign({ className: "d-flex" }, { children: [icon && jsx("span", __assign({ className: "mr8 " + styles.icon }, { children: icon }), void 0),
13
+ jsxs("div", { children: [jsx("p", __assign({ className: "p-p d-inline" }, { children: !onClickInfo ? (jsx("span", { children: label }, void 0)) : (jsx(TableButton, __assign({ className: "mr8", onClick: onClickInfo }, { children: label }), void 0)) }), void 0),
18
14
  subtitle && jsx("p", __assign({ className: "p-p--small tc-grey-500" }, { children: subtitle }), void 0)] }, void 0)] }), void 0));
19
15
  };
20
16
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableRowHeader/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\n\nimport TableInfoButton from '../TableInfoButton';\n\nimport styles from './style.module.scss';\n\nconst TableRowHeader = (props: {\n label: string;\n icon?: string;\n subtitle?: string;\n onClickInfo?: () => void;\n}) => {\n const { icon, label, subtitle, onClickInfo } = props;\n return (\n <div className=\"d-flex\">\n <span className={`mr8 ${styles.icon}`}>{icon}</span>\n <div>\n <p className=\"p-p d-inline\">\n <span\n className={classNames({\n mr8: onClickInfo,\n })}\n >\n {label}\n </span>\n {onClickInfo && <TableInfoButton onClick={onClickInfo} />}\n </p>\n {subtitle && <p className=\"p-p--small tc-grey-500\">{subtitle}</p>}\n </div>\n </div>\n );\n};\n\nexport default TableRowHeader;\n"],"names":["_jsxs","_jsx","classNames"],"mappings":";;;;;;;;;;IAOM,cAAc,GAAG,UAAC,KAKvB;IACS,IAAA,IAAI,GAAmC,KAAK,KAAxC,EAAE,KAAK,GAA4B,KAAK,MAAjC,EAAE,QAAQ,GAAkB,KAAK,SAAvB,EAAE,WAAW,GAAK,KAAK,YAAV,CAAW;IACrD,QACEA,uBAAK,SAAS,EAAC,QAAQ,iBACrBC,uBAAM,SAAS,EAAE,SAAO,MAAM,CAAC,IAAM,gBAAG,IAAI,YAAQ;YACpDD,yBACEA,qBAAG,SAAS,EAAC,cAAc,iBACzBC,uBACE,SAAS,EAAEC,UAAU,CAAC;oCACpB,GAAG,EAAE,WAAW;iCACjB,CAAC,gBAED,KAAK,YACD;4BACN,WAAW,IAAID,IAAC,eAAe,IAAC,OAAO,EAAE,WAAW,WAAI,aACvD;oBACH,QAAQ,IAAIA,oBAAG,SAAS,EAAC,wBAAwB,gBAAE,QAAQ,YAAK,YAC7D,aACF,EACN;AACJ;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableRowHeader/index.tsx"],"sourcesContent":["import TableButton from '../TableButton';\nimport styles from './style.module.scss';\n\ninterface TableRowHeaderProps {\n label: string;\n icon?: string;\n subtitle?: string;\n onClickInfo?: () => void;\n}\n\nconst TableRowHeader = ({ icon, label, subtitle, onClickInfo }: TableRowHeaderProps) => (\n <div className=\"d-flex\">\n {icon && <span className={`mr8 ${styles.icon}`}>{icon}</span>}\n <div>\n <p className=\"p-p d-inline\">\n {!onClickInfo ? (\n <span>{label}</span>\n ) : (\n <TableButton className=\"mr8\" onClick={onClickInfo}>\n {label}\n </TableButton>\n )}\n </p>\n {subtitle && <p className=\"p-p--small tc-grey-500\">{subtitle}</p>}\n </div>\n </div>\n);\n\nexport type { TableRowHeaderProps };\nexport default TableRowHeader;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;IAUM,cAAc,GAAG,UAAC,EAA2D;QAAzD,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,QAAQ,cAAA,EAAE,WAAW,iBAAA;IAA4B,QACtFA,uBAAK,SAAS,EAAC,QAAQ,iBACpB,IAAI,IAAIC,uBAAM,SAAS,EAAE,SAAO,MAAM,CAAC,IAAM,gBAAG,IAAI,YAAQ;YAC7DD,yBACEC,oBAAG,SAAS,EAAC,cAAc,gBACxB,CAAC,WAAW,IACXA,wBAAO,KAAK,WAAQ,KAEpBA,IAAC,WAAW,aAAC,SAAS,EAAC,KAAK,EAAC,OAAO,EAAE,WAAW,gBAC9C,KAAK,YACM,CACf,YACC;oBACH,QAAQ,IAAIA,oBAAG,SAAS,EAAC,wBAAwB,gBAAE,QAAQ,YAAK,YAC7D,aACF;AAfgF;;;;"}
@@ -0,0 +1,82 @@
1
+ import { _ as __assign, b as __awaiter, c as __generator } from '../../../../tslib.es6-5bc94358.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { c as customRender } from '../../../../customRender-4157fcff.js';
4
+ import '../../../../extend-expect-46bdce4a.js';
5
+ import TableRowHeader from './index.js';
6
+ import 'react';
7
+ import 'react-dom';
8
+ import '../../../../_commonjsHelpers-e7f67fd8.js';
9
+ import 'react-dom/test-utils';
10
+ import 'os';
11
+ import 'tty';
12
+ import '../TableButton/index.js';
13
+ import '../../../../style-inject.es-1f59c1d0.js';
14
+
15
+ var mockOnClick = jest.fn();
16
+ var label = "Table label";
17
+ var subtitle = "Subtitle label";
18
+ var icon = "🎉";
19
+ var buttonTestId = "ds-table-button";
20
+ var setup = function (props) {
21
+ if (props === void 0) { props = {}; }
22
+ return customRender(jsx(TableRowHeader, __assign({ label: label }, props), void 0));
23
+ };
24
+ describe('TableRowHeader component', function () {
25
+ it("should render label", function () {
26
+ var getByText = setup().getByText;
27
+ expect(getByText(label)).toBeInTheDocument();
28
+ });
29
+ it("should not render subtitle", function () {
30
+ var queryByText = setup().queryByText;
31
+ expect(queryByText(subtitle)).not.toBeInTheDocument();
32
+ });
33
+ it("should render subtitle", function () {
34
+ var getByText = setup({ subtitle: subtitle }).getByText;
35
+ expect(getByText(subtitle)).toBeInTheDocument();
36
+ });
37
+ it("should not render icon", function () {
38
+ var queryByText = setup().queryByText;
39
+ expect(queryByText(icon)).not.toBeInTheDocument();
40
+ });
41
+ it("should render icon", function () {
42
+ var getByText = setup({ icon: icon }).getByText;
43
+ expect(getByText(icon)).toBeInTheDocument();
44
+ });
45
+ it("should not render button if onClickInfo is not defined", function () {
46
+ var queryByTestId = setup().queryByTestId;
47
+ expect(queryByTestId(buttonTestId)).not.toBeInTheDocument();
48
+ });
49
+ it("should render button if onClickInfo is defined", function () {
50
+ var getByTestId = setup({ onClickInfo: mockOnClick }).getByTestId;
51
+ expect(getByTestId(buttonTestId)).toBeInTheDocument();
52
+ });
53
+ it("should not call onClickInfo if not defined", function () { return __awaiter(void 0, void 0, void 0, function () {
54
+ var _a, getByText, user;
55
+ return __generator(this, function (_b) {
56
+ switch (_b.label) {
57
+ case 0:
58
+ _a = setup(), getByText = _a.getByText, user = _a.user;
59
+ return [4 /*yield*/, user.click(getByText(label))];
60
+ case 1:
61
+ _b.sent();
62
+ expect(mockOnClick).not.toHaveBeenCalled();
63
+ return [2 /*return*/];
64
+ }
65
+ });
66
+ }); });
67
+ it("should call onClickInfo if defined", function () { return __awaiter(void 0, void 0, void 0, function () {
68
+ var _a, getByText, user;
69
+ return __generator(this, function (_b) {
70
+ switch (_b.label) {
71
+ case 0:
72
+ _a = setup({ onClickInfo: mockOnClick }), getByText = _a.getByText, user = _a.user;
73
+ return [4 /*yield*/, user.click(getByText(label))];
74
+ case 1:
75
+ _b.sent();
76
+ expect(mockOnClick).toHaveBeenCalled();
77
+ return [2 /*return*/];
78
+ }
79
+ });
80
+ }); });
81
+ });
82
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sources":["../../../../../../../src/lib/components/comparisonTable/components/TableRowHeader/index.test.tsx"],"sourcesContent":["import { render } from '../../../../util/testUtils';\nimport '@testing-library/jest-dom';\n\nimport TableRowHeader, { TableRowHeaderProps } from '.';\n\nconst mockOnClick = jest.fn();\n\nconst label = \"Table label\";\nconst subtitle = \"Subtitle label\";\nconst icon = \"🎉\";\nconst buttonTestId = \"ds-table-button\";\n\nconst setup = (props: Partial<TableRowHeaderProps> = {}) => render(\n <TableRowHeader \n label={label} \n {...props}\n />\n);\n\ndescribe('TableRowHeader component', () => {\n it(\"should render label\", () => {\n const { getByText } = setup();\n\n expect(getByText(label)).toBeInTheDocument();\n });\n\n it(\"should not render subtitle\", () => {\n const { queryByText } = setup();\n\n expect(queryByText(subtitle)).not.toBeInTheDocument();\n });\n\n it(\"should render subtitle\", () => {\n const { getByText } = setup({ subtitle });\n\n expect(getByText(subtitle)).toBeInTheDocument();\n });\n\n it(\"should not render icon\", () => {\n const { queryByText } = setup();\n\n expect(queryByText(icon)).not.toBeInTheDocument();\n });\n\n it(\"should render icon\", () => {\n const { getByText } = setup({ icon });\n\n expect(getByText(icon)).toBeInTheDocument();\n });\n\n it(\"should not render button if onClickInfo is not defined\", () => {\n const { queryByTestId } = setup();\n\n expect(queryByTestId(buttonTestId)).not.toBeInTheDocument();\n });\n\n it(\"should render button if onClickInfo is defined\", () => {\n const { getByTestId } = setup({ onClickInfo: mockOnClick });\n\n expect(getByTestId(buttonTestId)).toBeInTheDocument();\n });\n\n it(\"should not call onClickInfo if not defined\", async () => {\n const { getByText, user } = setup();\n\n await user.click(getByText(label));\n\n expect(mockOnClick).not.toHaveBeenCalled();\n });\n\n it(\"should call onClickInfo if defined\", async () => {\n const { getByText, user } = setup({ onClickInfo: mockOnClick });\n\n await user.click(getByText(label));\n\n expect(mockOnClick).toHaveBeenCalled();\n });\n});\n"],"names":["render","_jsx"],"mappings":"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"}
@@ -1,17 +1,18 @@
1
1
  import { b as __awaiter, c as __generator, _ as __assign } from '../../tslib.es6-5bc94358.js';
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { c as classnames } from '../../index-e9e37a34.js';
4
- import { c as commonjsGlobal } from '../../_commonjsHelpers-0f86abda.js';
4
+ import { c as commonjsGlobal } from '../../_commonjsHelpers-e7f67fd8.js';
5
5
  import React__default, { useState, useRef, useCallback, useEffect } from 'react';
6
6
  import ReactDOM from 'react-dom';
7
7
  import Chevron from './components/Chevron.js';
8
8
  import Row from './components/Row/index.js';
9
9
  import TableArrows from './components/TableArrows/index.js';
10
+ export { default as TableButton } from './components/TableButton/index.js';
10
11
  export { default as TableInfoButton } from './components/TableInfoButton/index.js';
11
12
  export { default as TableRating } from './components/TableRating/index.js';
12
13
  export { default as TableRowHeader } from './components/TableRowHeader/index.js';
13
14
  export { default as TableTrueFalse } from './components/TableTrueFalse.js';
14
- import { l as lodash_debounce } from '../../index-51913e93.js';
15
+ import { l as lodash_debounce } from '../../index-1463d5e9.js';
15
16
  import { s as styleInject } from '../../style-inject.es-1f59c1d0.js';
16
17
  import { AccordionItem } from './components/AccordionItem/AccordionItem.js';
17
18
  import './components/TableArrows/Arrow.js';