@nice-digital/nds-column-list 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/ColumnList.js CHANGED
@@ -23,6 +23,6 @@ const ColumnList = (props) => {
23
23
  className
24
24
  ]
25
25
  .filter(Boolean)
26
- .join(" ") }, attrs, { children: children })));
26
+ .join(" "), "data-component": `column-list${plain ? "--plain" : "--boxed"}` }, attrs, { children: children })));
27
27
  };
28
28
  exports.ColumnList = ColumnList;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-digital/nds-column-list",
3
- "version": "4.0.2-alpha.0",
3
+ "version": "4.0.3",
4
4
  "description": "Column List component for the NICE Design System",
5
5
  "main": "es/ColumnList.js",
6
6
  "style": "scss/column-list.js",
@@ -31,9 +31,9 @@
31
31
  "homepage": "https://design-system.nice.org.uk/",
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
- "@nice-digital/nds-core": "^4.0.2-alpha.0"
34
+ "@nice-digital/nds-core": "^4.0.3"
35
35
  },
36
- "gitHead": "4e9cad8a2b94cdf4af05b18a6610835883bedf0e",
36
+ "gitHead": "ae51389ba2e51dbe9ee3849e71d44fd567fb2822",
37
37
  "devDependencies": {
38
38
  "@testing-library/jest-dom": "^5.16.5",
39
39
  "@testing-library/react": "^13.4.0",
@@ -1 +0,0 @@
1
- export {};
@@ -1,36 +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 ColumnList_1 = require("./ColumnList");
6
- const ListItems = () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("li", { children: "One" }), (0, jsx_runtime_1.jsx)("li", { children: "Two" }), (0, jsx_runtime_1.jsx)("li", { children: "Three" }), (0, jsx_runtime_1.jsx)("li", { children: "Four" }), (0, jsx_runtime_1.jsx)("li", { children: "Five" }), (0, jsx_runtime_1.jsx)("li", { children: "Six" })] }));
7
- describe("ColumnList", () => {
8
- it("should match snapshot", () => {
9
- const wrapper = (0, react_1.render)((0, jsx_runtime_1.jsx)(ColumnList_1.ColumnList, { children: (0, jsx_runtime_1.jsx)(ListItems, {}) }));
10
- expect(wrapper).toMatchSnapshot();
11
- });
12
- it("should add CSS module class name to parent list for standard (boxed) variant", () => {
13
- const wrapper = (0, react_1.render)((0, jsx_runtime_1.jsx)(ColumnList_1.ColumnList, { children: (0, jsx_runtime_1.jsx)(ListItems, {}) }));
14
- expect(wrapper.getByRole("list")).toHaveClass("column-list--boxed");
15
- });
16
- it("should add CSS module class name to parent list for the plain variant", () => {
17
- const wrapper = (0, react_1.render)((0, jsx_runtime_1.jsx)(ColumnList_1.ColumnList, Object.assign({ plain: true }, { children: (0, jsx_runtime_1.jsx)(ListItems, {}) })));
18
- expect(wrapper.getByRole("list")).toHaveClass("column-list--plain");
19
- });
20
- it("should add CSS module class name to parent list for the 2 column variant", () => {
21
- const wrapper = (0, react_1.render)((0, jsx_runtime_1.jsx)(ColumnList_1.ColumnList, Object.assign({ columns: 2 }, { children: (0, jsx_runtime_1.jsx)(ListItems, {}) })));
22
- expect(wrapper.getByRole("list")).toHaveClass("column-list--two-columns");
23
- });
24
- it("should add no CSS module class name to parent list for the 3 column variant", () => {
25
- const wrapper = (0, react_1.render)((0, jsx_runtime_1.jsx)(ColumnList_1.ColumnList, Object.assign({ columns: 3 }, { children: (0, jsx_runtime_1.jsx)(ListItems, {}) })));
26
- expect(wrapper.getByRole("list")).not.toHaveClass("column-list--two-columns");
27
- });
28
- it("should append className prop to rendered class attribute", () => {
29
- const wrapper = (0, react_1.render)((0, jsx_runtime_1.jsx)(ColumnList_1.ColumnList, Object.assign({ className: "test" }, { children: (0, jsx_runtime_1.jsx)(ListItems, {}) })));
30
- expect(wrapper.getByRole("list")).toHaveClass("test");
31
- });
32
- it("should render additional props as attributes", () => {
33
- const wrapper = (0, react_1.render)((0, jsx_runtime_1.jsx)(ColumnList_1.ColumnList, Object.assign({ "aria-label": "hello" }, { children: (0, jsx_runtime_1.jsx)(ListItems, {}) })));
34
- expect(wrapper.getByRole("list").getAttribute("aria-label")).toBe("hello");
35
- });
36
- });