@nice-digital/nds-container 4.0.2-alpha.0 → 4.0.3
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/es/Container.js +1 -1
- package/package.json +3 -3
- package/es/Container.test.d.ts +0 -1
- package/es/Container.test.js +0 -29
package/es/Container.js
CHANGED
|
@@ -25,6 +25,6 @@ const Container = (props) => {
|
|
|
25
25
|
fullWidth && "container--full",
|
|
26
26
|
className
|
|
27
27
|
]);
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)(ElementType, Object.assign({ className: classes }, rest, { children: children })));
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(ElementType, Object.assign({ className: classes, "data-component": "container" }, rest, { children: children })));
|
|
29
29
|
};
|
|
30
30
|
exports.Container = Container;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-digital/nds-container",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
4
4
|
"description": "Container component for the NICE Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"container"
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"url": "https://github.com/nice-digital/nice-design-system/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@nice-digital/nds-core": "^4.0.
|
|
36
|
+
"@nice-digital/nds-core": "^4.0.3",
|
|
37
37
|
"classnames": "^2.2.6"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": "^16 || ^17 || ^18"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "ae51389ba2e51dbe9ee3849e71d44fd567fb2822",
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@testing-library/jest-dom": "^5.16.5",
|
|
45
45
|
"@testing-library/react": "^13.4.0",
|
package/es/Container.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/es/Container.test.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("@testing-library/react");
|
|
5
|
-
const Container_1 = require("./Container");
|
|
6
|
-
const Content = () => (0, jsx_runtime_1.jsx)("p", { children: "Test" });
|
|
7
|
-
describe("Container", () => {
|
|
8
|
-
it("should match snapshot", () => {
|
|
9
|
-
const wrapper = (0, react_1.render)((0, jsx_runtime_1.jsx)(Container_1.Container, { children: (0, jsx_runtime_1.jsx)(Content, {}) }));
|
|
10
|
-
expect(wrapper).toMatchSnapshot();
|
|
11
|
-
});
|
|
12
|
-
it("should add additional classNames", () => {
|
|
13
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(Container_1.Container, Object.assign({ className: "testclass" }, { children: (0, jsx_runtime_1.jsx)(Content, {}) })));
|
|
14
|
-
expect(container.querySelector(".container")).toHaveClass("testclass");
|
|
15
|
-
});
|
|
16
|
-
it("should add full width class if bool supplied", () => {
|
|
17
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(Container_1.Container, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(Content, {}) })));
|
|
18
|
-
expect(container.querySelector(".container")).toHaveClass("container--full");
|
|
19
|
-
});
|
|
20
|
-
it("should use elementType prop as rendered DOM node type", () => {
|
|
21
|
-
const wrapper = (0, react_1.render)((0, jsx_runtime_1.jsx)(Container_1.Container, Object.assign({ elementType: "main" }, { children: (0, jsx_runtime_1.jsx)(Content, {}) })));
|
|
22
|
-
expect(wrapper.getByRole("main")).toHaveClass("container");
|
|
23
|
-
});
|
|
24
|
-
it("should spread other props against the container", () => {
|
|
25
|
-
var _a;
|
|
26
|
-
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(Container_1.Container, Object.assign({ "data-track": "trackme" }, { children: (0, jsx_runtime_1.jsx)(Content, {}) })));
|
|
27
|
-
expect((_a = container.querySelector(".container")) === null || _a === void 0 ? void 0 : _a.getAttribute("data-track")).toBe("trackme");
|
|
28
|
-
});
|
|
29
|
-
});
|