@patternfly/react-core 4.260.0 → 4.260.1
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/esm/components/Text/TextList.js +1 -1
- package/dist/esm/components/Text/TextList.js.map +1 -1
- package/dist/esm/components/Text/TextListItem.js +1 -1
- package/dist/esm/components/Text/TextListItem.js.map +1 -1
- package/dist/esm/components/Text/__tests__/TextContent.text.d.ts +2 -0
- package/dist/esm/components/Text/__tests__/TextContent.text.d.ts.map +1 -0
- package/dist/esm/components/Text/__tests__/TextContent.text.js +37 -0
- package/dist/esm/components/Text/__tests__/TextContent.text.js.map +1 -0
- package/dist/js/components/Text/TextList.js +1 -1
- package/dist/js/components/Text/TextList.js.map +1 -1
- package/dist/js/components/Text/TextListItem.js +1 -1
- package/dist/js/components/Text/TextListItem.js.map +1 -1
- package/dist/js/components/Text/__tests__/TextContent.text.d.ts +2 -0
- package/dist/js/components/Text/__tests__/TextContent.text.d.ts.map +1 -0
- package/dist/js/components/Text/__tests__/TextContent.text.js +40 -0
- package/dist/js/components/Text/__tests__/TextContent.text.js.map +1 -0
- package/dist/umd/react-core.min.css +2186 -2186
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +2 -2
- package/src/components/Text/TextList.tsx +1 -1
- package/src/components/Text/TextListItem.tsx +1 -1
- package/src/components/Text/__tests__/Generated/__snapshots__/TextList.test.tsx.snap +0 -1
- package/src/components/Text/__tests__/Generated/__snapshots__/TextListItem.test.tsx.snap +0 -1
- package/src/components/Text/__tests__/Text.test.tsx +98 -109
- package/src/components/Text/__tests__/TextContent.text.tsx +47 -0
- package/src/components/Text/__tests__/TextList.test.tsx +52 -0
- package/src/components/Text/__tests__/TextListItem.test.tsx +52 -0
- package/src/components/Text/__tests__/__snapshots__/Text.test.tsx.snap +9 -328
- package/src/components/Text/__tests__/__snapshots__/TextContent.text.tsx.snap +11 -0
- package/src/components/Text/__tests__/__snapshots__/TextList.test.tsx.snap +11 -0
- package/src/components/Text/__tests__/__snapshots__/TextListItem.test.tsx.snap +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.260.1](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@4.260.0...@patternfly/react-core@4.260.1) (2022-11-09)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [4.260.0](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@4.259.0...@patternfly/react-core@4.260.0) (2022-11-08)
|
|
7
15
|
|
|
8
16
|
|
|
@@ -10,7 +10,7 @@ export var TextListVariants;
|
|
|
10
10
|
export const TextList = (_a) => {
|
|
11
11
|
var { children = null, className = '', component = TextListVariants.ul } = _a, props = __rest(_a, ["children", "className", "component"]);
|
|
12
12
|
const Component = component;
|
|
13
|
-
return (React.createElement(Component, Object.assign({}, props, {
|
|
13
|
+
return (React.createElement(Component, Object.assign({}, props, { className: css(className) }), children));
|
|
14
14
|
};
|
|
15
15
|
TextList.displayName = 'TextList';
|
|
16
16
|
//# sourceMappingURL=TextList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextList.js","sourceRoot":"","sources":["../../../../src/components/Text/TextList.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,6BAAS,CAAA;IACT,6BAAS,CAAA;IACT,6BAAS,CAAA;AACX,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAWD,MAAM,CAAC,MAAM,QAAQ,GAA2C,CAAC,EAKjD,EAAE,EAAE;QAL6C,EAC/D,QAAQ,GAAG,IAAI,EACf,SAAS,GAAG,EAAE,EACd,SAAS,GAAG,gBAAgB,CAAC,EAAE,OAEjB,EADX,KAAK,cAJuD,sCAKhE,CADS;IAER,MAAM,SAAS,GAAQ,SAAS,CAAC;IAEjC,OAAO,CACL,oBAAC,SAAS,oBAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"TextList.js","sourceRoot":"","sources":["../../../../src/components/Text/TextList.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,6BAAS,CAAA;IACT,6BAAS,CAAA;IACT,6BAAS,CAAA;AACX,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAWD,MAAM,CAAC,MAAM,QAAQ,GAA2C,CAAC,EAKjD,EAAE,EAAE;QAL6C,EAC/D,QAAQ,GAAG,IAAI,EACf,SAAS,GAAG,EAAE,EACd,SAAS,GAAG,gBAAgB,CAAC,EAAE,OAEjB,EADX,KAAK,cAJuD,sCAKhE,CADS;IAER,MAAM,SAAS,GAAQ,SAAS,CAAC;IAEjC,OAAO,CACL,oBAAC,SAAS,oBAAK,KAAK,IAAE,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,KAC5C,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -10,7 +10,7 @@ export var TextListItemVariants;
|
|
|
10
10
|
export const TextListItem = (_a) => {
|
|
11
11
|
var { children = null, className = '', component = TextListItemVariants.li } = _a, props = __rest(_a, ["children", "className", "component"]);
|
|
12
12
|
const Component = component;
|
|
13
|
-
return (React.createElement(Component, Object.assign({}, props, {
|
|
13
|
+
return (React.createElement(Component, Object.assign({}, props, { className: css(className) }), children));
|
|
14
14
|
};
|
|
15
15
|
TextListItem.displayName = 'TextListItem';
|
|
16
16
|
//# sourceMappingURL=TextListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextListItem.js","sourceRoot":"","sources":["../../../../src/components/Text/TextListItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,iCAAS,CAAA;IACT,iCAAS,CAAA;IACT,iCAAS,CAAA;AACX,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAWD,MAAM,CAAC,MAAM,YAAY,GAA+C,CAAC,EAKrD,EAAE,EAAE;QALiD,EACvE,QAAQ,GAAG,IAAI,EACf,SAAS,GAAG,EAAE,EACd,SAAS,GAAG,oBAAoB,CAAC,EAAE,OAEjB,EADf,KAAK,cAJ+D,sCAKxE,CADS;IAER,MAAM,SAAS,GAAQ,SAAS,CAAC;IAEjC,OAAO,CACL,oBAAC,SAAS,oBAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"TextListItem.js","sourceRoot":"","sources":["../../../../src/components/Text/TextListItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,iCAAS,CAAA;IACT,iCAAS,CAAA;IACT,iCAAS,CAAA;AACX,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAWD,MAAM,CAAC,MAAM,YAAY,GAA+C,CAAC,EAKrD,EAAE,EAAE;QALiD,EACvE,QAAQ,GAAG,IAAI,EACf,SAAS,GAAG,EAAE,EACd,SAAS,GAAG,oBAAoB,CAAC,EAAE,OAEjB,EADf,KAAK,cAJ+D,sCAKxE,CADS;IAER,MAAM,SAAS,GAAQ,SAAS,CAAC;IAEjC,OAAO,CACL,oBAAC,SAAS,oBAAK,KAAK,IAAE,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,KAC5C,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextContent.text.d.ts","sourceRoot":"","sources":["../../../../../src/components/Text/__tests__/TextContent.text.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { TextContent } from '../TextContent';
|
|
4
|
+
test('Renders without children', () => {
|
|
5
|
+
render(React.createElement("div", { "data-testid": "test-content" },
|
|
6
|
+
React.createElement(TextContent, null)));
|
|
7
|
+
expect(screen.getByTestId('test-content').firstChild).toBeVisible();
|
|
8
|
+
});
|
|
9
|
+
test('Renders children', () => {
|
|
10
|
+
render(React.createElement(TextContent, null, "Test"));
|
|
11
|
+
expect(screen.getByText('Test')).toBeVisible();
|
|
12
|
+
});
|
|
13
|
+
test('Renders with class name pf-c-content', () => {
|
|
14
|
+
render(React.createElement(TextContent, null, "Test"));
|
|
15
|
+
expect(screen.getByText('Test')).toHaveClass('pf-c-content', { exact: true });
|
|
16
|
+
});
|
|
17
|
+
test('Renders with custom class name when className prop is provided', () => {
|
|
18
|
+
render(React.createElement(TextContent, { className: "custom-class" }, "Test"));
|
|
19
|
+
expect(screen.getByText('Test')).toHaveClass('custom-class');
|
|
20
|
+
});
|
|
21
|
+
test('Renders without class name pf-m-visited by default', () => {
|
|
22
|
+
render(React.createElement(TextContent, null, "Test"));
|
|
23
|
+
expect(screen.getByText('Test')).not.toHaveClass('pf-m-visited');
|
|
24
|
+
});
|
|
25
|
+
test('Renders with class name pf-m-visited when isVisited=true', () => {
|
|
26
|
+
render(React.createElement(TextContent, { isVisited: true }, "Test"));
|
|
27
|
+
expect(screen.getByText('Test')).toHaveClass('pf-m-visited');
|
|
28
|
+
});
|
|
29
|
+
test('Renders with inherited element props spread to the component', () => {
|
|
30
|
+
render(React.createElement(TextContent, { "aria-label": "Test label" }, "Test"));
|
|
31
|
+
expect(screen.getByText('Test')).toHaveAccessibleName('Test label');
|
|
32
|
+
});
|
|
33
|
+
test('Matches the snapshot', () => {
|
|
34
|
+
const { asFragment } = render(React.createElement(TextContent, null, "Test"));
|
|
35
|
+
expect(asFragment()).toMatchSnapshot();
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=TextContent.text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextContent.text.js","sourceRoot":"","sources":["../../../../../src/components/Text/__tests__/TextContent.text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,IAAI,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACpC,MAAM,CACJ,4CAAiB,cAAc;QAC7B,oBAAC,WAAW,OAAG,CACX,CACP,CAAC;IACF,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;AACtE,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAC5B,MAAM,CAAC,oBAAC,WAAW,eAAmB,CAAC,CAAC;IACxC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AACjD,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,sCAAsC,EAAE,GAAG,EAAE;IAChD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AAC,oBAAC,WAAW,eAAmB,CAAC,CAAC;IAC/D,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;AACzC,CAAC,CAAC,CAAC"}
|
|
@@ -13,7 +13,7 @@ var TextListVariants;
|
|
|
13
13
|
const TextList = (_a) => {
|
|
14
14
|
var { children = null, className = '', component = TextListVariants.ul } = _a, props = tslib_1.__rest(_a, ["children", "className", "component"]);
|
|
15
15
|
const Component = component;
|
|
16
|
-
return (React.createElement(Component, Object.assign({}, props, {
|
|
16
|
+
return (React.createElement(Component, Object.assign({}, props, { className: react_styles_1.css(className) }), children));
|
|
17
17
|
};
|
|
18
18
|
exports.TextList = TextList;
|
|
19
19
|
exports.TextList.displayName = 'TextList';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextList.js","sourceRoot":"","sources":["../../../../src/components/Text/TextList.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,2DAA+C;AAE/C,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,6BAAS,CAAA;IACT,6BAAS,CAAA;IACT,6BAAS,CAAA;AACX,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B;AAWM,MAAM,QAAQ,GAA2C,CAAC,EAKjD,EAAE,EAAE;QAL6C,EAC/D,QAAQ,GAAG,IAAI,EACf,SAAS,GAAG,EAAE,EACd,SAAS,GAAG,gBAAgB,CAAC,EAAE,OAEjB,EADX,KAAK,sBAJuD,sCAKhE,CADS;IAER,MAAM,SAAS,GAAQ,SAAS,CAAC;IAEjC,OAAO,CACL,oBAAC,SAAS,oBAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"TextList.js","sourceRoot":"","sources":["../../../../src/components/Text/TextList.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,2DAA+C;AAE/C,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,6BAAS,CAAA;IACT,6BAAS,CAAA;IACT,6BAAS,CAAA;AACX,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B;AAWM,MAAM,QAAQ,GAA2C,CAAC,EAKjD,EAAE,EAAE;QAL6C,EAC/D,QAAQ,GAAG,IAAI,EACf,SAAS,GAAG,EAAE,EACd,SAAS,GAAG,gBAAgB,CAAC,EAAE,OAEjB,EADX,KAAK,sBAJuD,sCAKhE,CADS;IAER,MAAM,SAAS,GAAQ,SAAS,CAAC;IAEjC,OAAO,CACL,oBAAC,SAAS,oBAAK,KAAK,IAAE,SAAS,EAAE,kBAAG,CAAC,SAAS,CAAC,KAC5C,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,QAAQ,YAanB;AACF,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -13,7 +13,7 @@ var TextListItemVariants;
|
|
|
13
13
|
const TextListItem = (_a) => {
|
|
14
14
|
var { children = null, className = '', component = TextListItemVariants.li } = _a, props = tslib_1.__rest(_a, ["children", "className", "component"]);
|
|
15
15
|
const Component = component;
|
|
16
|
-
return (React.createElement(Component, Object.assign({}, props, {
|
|
16
|
+
return (React.createElement(Component, Object.assign({}, props, { className: react_styles_1.css(className) }), children));
|
|
17
17
|
};
|
|
18
18
|
exports.TextListItem = TextListItem;
|
|
19
19
|
exports.TextListItem.displayName = 'TextListItem';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextListItem.js","sourceRoot":"","sources":["../../../../src/components/Text/TextListItem.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,2DAA+C;AAE/C,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,iCAAS,CAAA;IACT,iCAAS,CAAA;IACT,iCAAS,CAAA;AACX,CAAC,EAJW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAI/B;AAWM,MAAM,YAAY,GAA+C,CAAC,EAKrD,EAAE,EAAE;QALiD,EACvE,QAAQ,GAAG,IAAI,EACf,SAAS,GAAG,EAAE,EACd,SAAS,GAAG,oBAAoB,CAAC,EAAE,OAEjB,EADf,KAAK,sBAJ+D,sCAKxE,CADS;IAER,MAAM,SAAS,GAAQ,SAAS,CAAC;IAEjC,OAAO,CACL,oBAAC,SAAS,oBAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"TextListItem.js","sourceRoot":"","sources":["../../../../src/components/Text/TextListItem.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,2DAA+C;AAE/C,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,iCAAS,CAAA;IACT,iCAAS,CAAA;IACT,iCAAS,CAAA;AACX,CAAC,EAJW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAI/B;AAWM,MAAM,YAAY,GAA+C,CAAC,EAKrD,EAAE,EAAE;QALiD,EACvE,QAAQ,GAAG,IAAI,EACf,SAAS,GAAG,EAAE,EACd,SAAS,GAAG,oBAAoB,CAAC,EAAE,OAEjB,EADf,KAAK,sBAJ+D,sCAKxE,CADS;IAER,MAAM,SAAS,GAAQ,SAAS,CAAC;IAEjC,OAAO,CACL,oBAAC,SAAS,oBAAK,KAAK,IAAE,SAAS,EAAE,kBAAG,CAAC,SAAS,CAAC,KAC5C,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,YAAY,gBAavB;AACF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextContent.text.d.ts","sourceRoot":"","sources":["../../../../../src/components/Text/__tests__/TextContent.text.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const react_1 = require("@testing-library/react");
|
|
6
|
+
const TextContent_1 = require("../TextContent");
|
|
7
|
+
test('Renders without children', () => {
|
|
8
|
+
react_1.render(React.createElement("div", { "data-testid": "test-content" },
|
|
9
|
+
React.createElement(TextContent_1.TextContent, null)));
|
|
10
|
+
expect(react_1.screen.getByTestId('test-content').firstChild).toBeVisible();
|
|
11
|
+
});
|
|
12
|
+
test('Renders children', () => {
|
|
13
|
+
react_1.render(React.createElement(TextContent_1.TextContent, null, "Test"));
|
|
14
|
+
expect(react_1.screen.getByText('Test')).toBeVisible();
|
|
15
|
+
});
|
|
16
|
+
test('Renders with class name pf-c-content', () => {
|
|
17
|
+
react_1.render(React.createElement(TextContent_1.TextContent, null, "Test"));
|
|
18
|
+
expect(react_1.screen.getByText('Test')).toHaveClass('pf-c-content', { exact: true });
|
|
19
|
+
});
|
|
20
|
+
test('Renders with custom class name when className prop is provided', () => {
|
|
21
|
+
react_1.render(React.createElement(TextContent_1.TextContent, { className: "custom-class" }, "Test"));
|
|
22
|
+
expect(react_1.screen.getByText('Test')).toHaveClass('custom-class');
|
|
23
|
+
});
|
|
24
|
+
test('Renders without class name pf-m-visited by default', () => {
|
|
25
|
+
react_1.render(React.createElement(TextContent_1.TextContent, null, "Test"));
|
|
26
|
+
expect(react_1.screen.getByText('Test')).not.toHaveClass('pf-m-visited');
|
|
27
|
+
});
|
|
28
|
+
test('Renders with class name pf-m-visited when isVisited=true', () => {
|
|
29
|
+
react_1.render(React.createElement(TextContent_1.TextContent, { isVisited: true }, "Test"));
|
|
30
|
+
expect(react_1.screen.getByText('Test')).toHaveClass('pf-m-visited');
|
|
31
|
+
});
|
|
32
|
+
test('Renders with inherited element props spread to the component', () => {
|
|
33
|
+
react_1.render(React.createElement(TextContent_1.TextContent, { "aria-label": "Test label" }, "Test"));
|
|
34
|
+
expect(react_1.screen.getByText('Test')).toHaveAccessibleName('Test label');
|
|
35
|
+
});
|
|
36
|
+
test('Matches the snapshot', () => {
|
|
37
|
+
const { asFragment } = react_1.render(React.createElement(TextContent_1.TextContent, null, "Test"));
|
|
38
|
+
expect(asFragment()).toMatchSnapshot();
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=TextContent.text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextContent.text.js","sourceRoot":"","sources":["../../../../../src/components/Text/__tests__/TextContent.text.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,kDAAwD;AACxD,gDAA6C;AAE7C,IAAI,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACpC,cAAM,CACJ,4CAAiB,cAAc;QAC7B,oBAAC,yBAAW,OAAG,CACX,CACP,CAAC;IACF,MAAM,CAAC,cAAM,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;AACtE,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAC5B,cAAM,CAAC,oBAAC,yBAAW,eAAmB,CAAC,CAAC;IACxC,MAAM,CAAC,cAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AACjD,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,sCAAsC,EAAE,GAAG,EAAE;IAChD,cAAM,CAAC,oBAAC,yBAAW,eAAmB,CAAC,CAAC;IACxC,MAAM,CAAC,cAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAChF,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,gEAAgE,EAAE,GAAG,EAAE;IAC1E,cAAM,CAAC,oBAAC,yBAAW,IAAC,SAAS,EAAC,cAAc,WAAmB,CAAC,CAAC;IACjE,MAAM,CAAC,cAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;AAC/D,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,oDAAoD,E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