@hortiview/shared-components 2.1.0 → 2.2.0

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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## [2.2.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.1.0...v2.2.0) (2025-07-24)
2
+
3
+ ### Features
4
+
5
+ * add new data-testids and fix onboardingbanner test ([1ac90c1](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/1ac90c1c4db3ff909e6ac3beb52863e6a8e55937))
6
+
1
7
  ## [2.1.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.0.0...v2.1.0) (2025-06-11)
2
8
 
3
9
  ### Features
@@ -1,27 +1,27 @@
1
- import { jsx as r, jsxs as z } from "react/jsx-runtime";
2
- import { G as B } from "./index.es-DntoATwO.js";
3
- import { I as C } from "./index.es-3043KTnb.js";
4
- import { c as b, d as N, T as O } from "./index.es-D54RuMc_.js";
5
- import { Iconify as $ } from "./components/Iconify/Iconify.js";
6
- import { AvailableCustomIcons as k } from "./enums/AvailableCustomIcons.js";
7
- import './assets/ListAreaService.css';const E = "_fullWidth_zewqs_1", j = "_mainElevation_zewqs_5", G = "_searchbar_zewqs_11", W = "_roundedBottom_zewqs_19", L = "_primaryText_zewqs_24", S = "_list_zewqs_28", A = "_listItem_zewqs_56", P = "_iconColor_zewqs_76", D = "_overlineTitle_zewqs_80", F = "_noOverlineTitle_zewqs_85", H = "_truncate_zewqs_89", J = "_truncateOverlineText_zewqs_100", n = {
8
- fullWidth: E,
9
- mainElevation: j,
10
- searchbar: G,
11
- roundedBottom: W,
12
- primaryText: L,
13
- list: S,
14
- listItem: A,
15
- iconColor: P,
16
- overlineTitle: D,
17
- noOverlineTitle: F,
18
- truncate: H,
19
- truncateOverlineText: J
20
- }, Z = (t, s, a, l) => {
1
+ import { jsx as r, jsxs as B } from "react/jsx-runtime";
2
+ import { G as C } from "./index.es-DntoATwO.js";
3
+ import { I as b } from "./index.es-3043KTnb.js";
4
+ import { c as N, d as O, T as $ } from "./index.es-D54RuMc_.js";
5
+ import { Iconify as k } from "./components/Iconify/Iconify.js";
6
+ import { AvailableCustomIcons as E } from "./enums/AvailableCustomIcons.js";
7
+ import './assets/ListAreaService.css';const j = "_fullWidth_zewqs_1", G = "_mainElevation_zewqs_5", W = "_searchbar_zewqs_11", L = "_roundedBottom_zewqs_19", S = "_primaryText_zewqs_24", A = "_list_zewqs_28", P = "_listItem_zewqs_56", D = "_iconColor_zewqs_76", F = "_overlineTitle_zewqs_80", H = "_noOverlineTitle_zewqs_85", J = "_truncate_zewqs_89", K = "_truncateOverlineText_zewqs_100", n = {
8
+ fullWidth: j,
9
+ mainElevation: G,
10
+ searchbar: W,
11
+ roundedBottom: L,
12
+ primaryText: S,
13
+ list: A,
14
+ listItem: P,
15
+ iconColor: D,
16
+ overlineTitle: F,
17
+ noOverlineTitle: H,
18
+ truncate: J,
19
+ truncateOverlineText: K
20
+ }, ee = (t, s, a, l) => {
21
21
  const i = t.reduce((o, c) => {
22
22
  const { groupName: e, ...m } = c;
23
23
  return !e || typeof e != "string" || (o[e] || (o[e] = {
24
- groupName: /* @__PURE__ */ r(b, { children: e }),
24
+ groupName: /* @__PURE__ */ r(N, { children: e }),
25
25
  id: e,
26
26
  items: []
27
27
  }), o[e].items = [
@@ -30,7 +30,7 @@ import './assets/ListAreaService.css';const E = "_fullWidth_zewqs_1", j = "_main
30
30
  ]), o;
31
31
  }, {});
32
32
  return Object.values(i);
33
- }, ee = (t, s, a, l) => t.map((i) => y(i, s, a, l)), y = (t, s, a, l) => {
33
+ }, te = (t, s, a, l) => t.map((i) => y(i, s, a, l)), y = (t, s, a, l) => {
34
34
  const {
35
35
  id: i,
36
36
  title: o,
@@ -47,16 +47,17 @@ import './assets/ListAreaService.css';const E = "_fullWidth_zewqs_1", j = "_main
47
47
  onClick: w,
48
48
  customTitle: T,
49
49
  listItemClassName: x,
50
- overlineTitle: _
50
+ overlineTitle: _,
51
+ "data-testid": q
51
52
  } = t, u = s === e;
52
53
  return {
53
54
  id: i,
54
55
  key: i,
55
56
  select: u,
56
57
  primaryText: i,
57
- secondaryText: /* @__PURE__ */ z(B, { direction: "vertical", gap: "none", children: [
58
+ secondaryText: /* @__PURE__ */ B(C, { direction: "vertical", gap: "none", children: [
58
59
  T ?? /* @__PURE__ */ r(
59
- N,
60
+ O,
60
61
  {
61
62
  "data-testid": "title",
62
63
  level: 1,
@@ -66,7 +67,7 @@ import './assets/ListAreaService.css';const E = "_fullWidth_zewqs_1", j = "_main
66
67
  }
67
68
  ),
68
69
  c && !T ? /* @__PURE__ */ r(
69
- O,
70
+ $,
70
71
  {
71
72
  "data-testid": "subtitle",
72
73
  level: 2,
@@ -84,26 +85,26 @@ import './assets/ListAreaService.css';const E = "_fullWidth_zewqs_1", j = "_main
84
85
  children: _
85
86
  }
86
87
  ) : void 0,
87
- trailingBlock: I ?? f ?? /* @__PURE__ */ r(C, { icon: "arrow_right", className: n.iconColor }),
88
- leadingBlock: K(g),
88
+ trailingBlock: I ?? f ?? /* @__PURE__ */ r(b, { icon: "arrow_right", className: n.iconColor }),
89
+ leadingBlock: M(g),
89
90
  value: m,
90
91
  componentProps: {
91
92
  id: i,
92
- "data-testid": `${o}-list-item`,
93
+ "data-testid": `${q ?? o}-list-item`,
93
94
  key: i,
94
95
  leadingBlockType: p ?? "icon",
95
96
  trailingBlockType: h ?? "icon",
96
97
  className: `${p === "avatar" ? "" : n.listItem} ${a} ${x ?? ""} ${_ ? n.overlineTitle : n.noOverlineTitle}`,
97
- onClick: (M, q) => w?.(q),
98
+ onClick: (Q, z) => w?.(z),
98
99
  tag: d || v ? void 0 : l ?? "a",
99
100
  to: d || v ? void 0 : e,
100
101
  disabled: d
101
102
  }
102
103
  };
103
- }, K = (t) => typeof t == "string" && t in k ? /* @__PURE__ */ r($, { icon: t }) : t;
104
+ }, M = (t) => typeof t == "string" && t in E ? /* @__PURE__ */ r(k, { icon: t }) : t;
104
105
  export {
105
- ee as a,
106
- Z as g,
106
+ te as a,
107
+ ee as g,
107
108
  y as m,
108
109
  n as s
109
110
  };
@@ -15,9 +15,14 @@ type ContextMenuProps = {
15
15
  * Default is 'vertical'
16
16
  */
17
17
  iconOrientation?: 'vertical' | 'horizontal';
18
+ /**
19
+ * data-testid for testing
20
+ */
21
+ 'data-testid'?: string;
18
22
  };
19
23
  export type ActionProps = ListItemProps & {
20
24
  closeOnClick?: boolean;
25
+ 'data-testid'?: string;
21
26
  };
22
27
  /**
23
28
  *
@@ -32,5 +37,5 @@ export type ActionProps = ListItemProps & {
32
37
  * ];
33
38
  * @returns a context menu with the given actions as ListItems
34
39
  */
35
- export declare const ContextMenu: ({ triggerOpen, actions, iconOrientation, }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
40
+ export declare const ContextMenu: ({ triggerOpen, actions, iconOrientation, "data-testid": dataTestId, }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
36
41
  export {};
@@ -1,60 +1,61 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { I as f } from "../../index.es-0lQcz8m1.js";
3
- import { M as d, L as _, a as p } from "../../index.es-fnFnw2P1.js";
4
- import { useState as I, useCallback as a, useEffect as v } from "react";
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { I as d } from "../../index.es-0lQcz8m1.js";
3
+ import { M as f, L as _, a as I } from "../../index.es-fnFnw2P1.js";
4
+ import { useState as p, useCallback as a, useEffect as v } from "react";
5
5
  import { u as C } from "../../uniqueId-NU3-C36A.js";
6
- import '../../assets/ContextMenu.css';const k = "_menu_ol91v_1", y = "_icon_ol91v_5", M = "_listItem_ol91v_9", l = {
6
+ import '../../assets/ContextMenu.css';const k = "_menu_ol91v_1", y = "_icon_ol91v_5", M = "_listItem_ol91v_9", i = {
7
7
  menu: k,
8
8
  icon: y,
9
9
  listItem: M
10
- }, N = ({
11
- triggerOpen: s = null,
10
+ }, T = ({
11
+ triggerOpen: n = null,
12
12
  actions: c,
13
- iconOrientation: m = "vertical"
13
+ iconOrientation: m = "vertical",
14
+ "data-testid": r
14
15
  }) => {
15
- const [e, t] = I(!1), r = a(() => {
16
- t(!e);
17
- }, [e]), i = a(() => {
18
- t(!1);
16
+ const [t, s] = p(!1), u = a(() => {
17
+ s(!t);
18
+ }, [t]), l = a(() => {
19
+ s(!1);
19
20
  }, []);
20
21
  return v(() => {
21
- t(s !== null ? s : !1);
22
- }, [s]), /* @__PURE__ */ n(
23
- d,
22
+ s(n !== null ? n : !1);
23
+ }, [n]), /* @__PURE__ */ o(
24
+ f,
24
25
  {
25
- className: l.menu,
26
- "data-testid": "selection-menu",
27
- open: e,
26
+ className: i.menu,
27
+ "data-testid": r ?? "selection-menu",
28
+ open: t,
28
29
  surfaceOnly: !0,
29
30
  hoistToBody: !0,
30
- onClose: i,
31
- trigger: /* @__PURE__ */ n(
32
- f,
31
+ onClose: l,
32
+ trigger: /* @__PURE__ */ o(
33
+ d,
33
34
  {
34
- className: l.icon,
35
- variant: e ? "filled-primary" : void 0,
35
+ className: i.icon,
36
+ variant: t ? "filled-primary" : void 0,
36
37
  "data-testid": "open-button",
37
38
  icon: m === "vertical" ? "more_vert" : "more_horiz",
38
- onClick: r
39
+ onClick: u
39
40
  }
40
41
  ),
41
- children: /* @__PURE__ */ n(_, { children: c.map((o, u) => /* @__PURE__ */ n(
42
- p,
42
+ children: /* @__PURE__ */ o(_, { "data-testid": "selection-list", children: c.map((e) => /* @__PURE__ */ o(
43
+ I,
43
44
  {
44
- className: l.listItem,
45
- ...o,
45
+ className: i.listItem,
46
+ ...e,
46
47
  leadingBlockType: "icon",
47
- "data-testid": `list-item-button-${u}`,
48
+ "data-testid": e["data-testid"],
48
49
  onClick: () => {
49
- o?.onClick?.(), o.closeOnClick !== !1 && i();
50
+ e?.onClick?.(), e.closeOnClick !== !1 && l();
50
51
  }
51
52
  },
52
- C(`LI_${o.primaryText?.toString()}_`)
53
+ C(`LI_${e.primaryText?.toString()}_`)
53
54
  )) })
54
55
  },
55
56
  "selectionmenu"
56
57
  );
57
58
  };
58
59
  export {
59
- N as ContextMenu
60
+ T as ContextMenu
60
61
  };
@@ -1,11 +1,11 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { a as B, s as t, f as o, w as s } from "../../react.esm-CX1WJ2Pp.js";
3
3
  import { ContextMenu as p } from "./ContextMenu.js";
4
- import { a as l, d as k, t as T, g as e } from "../../vi.CjhMlMwf-CKxPQtd6.js";
5
- const C = l.fn(), a = l.fn(), i = l.fn(), g = [
6
- { primaryText: "Open", onClick: C, leadingBlock: "add" },
7
- { primaryText: "Delete", onClick: i, leadingBlock: "delete_outline" },
8
- { primaryText: "Edit", onClick: a, leadingBlock: "edit" }
4
+ import { a as d, d as k, t as T, g as e } from "../../vi.CjhMlMwf-CKxPQtd6.js";
5
+ const C = d.fn(), a = d.fn(), i = d.fn(), g = [
6
+ { primaryText: "Open", onClick: C, leadingBlock: "add", "data-testid": "open-testid" },
7
+ { primaryText: "Delete", onClick: i, leadingBlock: "delete_outline", "data-testid": "delete-testid" },
8
+ { primaryText: "Edit", onClick: a, leadingBlock: "edit", "data-testid": "edit-testid" }
9
9
  ];
10
10
  k("ContextMenu Test", () => {
11
11
  T("render contextMenu and close it", () => {
@@ -16,7 +16,7 @@ k("ContextMenu Test", () => {
16
16
  B(/* @__PURE__ */ r(p, { actions: g, triggerOpen: !0 }));
17
17
  const c = t.getByTestId("open-button"), n = t.getByTestId("selection-menu");
18
18
  e(n).toBeInTheDocument(), e(n).not.toHaveClass("mdc-menu-surface--open"), o.click(c), await s(() => e(n).toHaveClass("mdc-menu-surface--animating-open")), e(t.getByText("Open")).toBeInTheDocument(), e(t.getByText("Delete")).toBeInTheDocument(), e(t.getByText("Edit")).toBeInTheDocument();
19
- const m = t.getByTestId("list-item-button-0"), u = t.getByTestId("list-item-button-1"), d = t.getByTestId("list-item-button-2");
20
- e(m).toBeInTheDocument(), e(u).toBeInTheDocument(), e(d).toBeInTheDocument(), o.click(m), e(C).toHaveBeenCalled(), e(i).not.toHaveBeenCalled(), e(a).not.toHaveBeenCalled(), o.click(u), e(i).toHaveBeenCalled(), o.click(d), e(a).toHaveBeenCalled();
19
+ const l = t.getByTestId("open-testid"), m = t.getByTestId("delete-testid"), u = t.getByTestId("edit-testid");
20
+ e(l).toBeInTheDocument(), e(m).toBeInTheDocument(), e(u).toBeInTheDocument(), o.click(l), e(C).toHaveBeenCalled(), e(i).not.toHaveBeenCalled(), e(a).not.toHaveBeenCalled(), o.click(m), e(i).toHaveBeenCalled(), o.click(u), e(a).toHaveBeenCalled();
21
21
  });
22
22
  });
@@ -42,6 +42,10 @@ type ListAreaProps = {
42
42
  * noElementsView is the view to be displayed when the list is empty
43
43
  */
44
44
  noElementsView?: JSX.Element;
45
+ /**
46
+ * data-testid for testing
47
+ */
48
+ 'data-testid'?: string;
45
49
  /**
46
50
  * routerLinkElement is the element to be used for the elements link, use react-router Link component for the best experience.
47
51
  * If the element has `noNavigation=false` and the `routerLinkElement` is undefined an `<a>` tag is used.
@@ -54,5 +58,5 @@ type ListAreaProps = {
54
58
  * list elements act as router links to the corresponding route.
55
59
  * The list will be displayed in the desktop view or when no detail view is selected (in mobile view).
56
60
  */
57
- export declare const ListArea: ({ elements, pathname, isGrouped, hasSearch, searchPlaceholder, isIntegrated, isSorted, itemClassName, maxHeight, noElementsView, routerLinkElement, }: ListAreaProps) => import("react/jsx-runtime").JSX.Element;
61
+ export declare const ListArea: ({ elements, pathname, isGrouped, hasSearch, searchPlaceholder, isIntegrated, isSorted, itemClassName, maxHeight, noElementsView, "data-testid": dataTestId, routerLinkElement, }: ListAreaProps) => import("react/jsx-runtime").JSX.Element;
58
62
  export {};
@@ -1,12 +1,12 @@
1
1
  import { jsx as s, jsxs as h } from "react/jsx-runtime";
2
2
  import { D as u } from "../../index.es-BWgXLqXn.js";
3
- import { E as y } from "../../index.es-h2lMdt7G.js";
4
- import { L as C } from "../../index.es-fnFnw2P1.js";
3
+ import { E as C } from "../../index.es-h2lMdt7G.js";
4
+ import { L as b } from "../../index.es-fnFnw2P1.js";
5
5
  import { o as p } from "../../orderBy-Bd48bw88.js";
6
- import { useState as b, useMemo as v } from "react";
7
- import { SearchBar as B } from "../SearchBar/SearchBar.js";
8
- import { g as D, a as j, s as t } from "../../ListAreaService-Wq9IkwWN.js";
9
- const q = ({
6
+ import { useState as B, useMemo as v } from "react";
7
+ import { SearchBar as D } from "../SearchBar/SearchBar.js";
8
+ import { g as j, a as E, s as e } from "../../ListAreaService-BVtuBN0K.js";
9
+ const z = ({
10
10
  elements: r,
11
11
  pathname: o,
12
12
  isGrouped: i = !1,
@@ -17,31 +17,32 @@ const q = ({
17
17
  itemClassName: c = "",
18
18
  maxHeight: T = "100%",
19
19
  noElementsView: $,
20
+ "data-testid": g,
20
21
  routerLinkElement: d
21
22
  }) => {
22
- const [e, g] = b(""), a = v(() => {
23
- if (!e) return l ? p(r, "title") : r;
24
- const n = r.filter((f) => f.title.toLowerCase().includes(e.toLowerCase()) || f.subTitle?.toLowerCase().includes(e.toLowerCase()) || f.overlineTitle?.toLowerCase().includes(e.toLowerCase()));
23
+ const [t, x] = B(""), a = v(() => {
24
+ if (!t) return l ? p(r, "title") : r;
25
+ const n = r.filter((f) => f.title.toLowerCase().includes(t.toLowerCase()) || f.subTitle?.toLowerCase().includes(t.toLowerCase()) || f.overlineTitle?.toLowerCase().includes(t.toLowerCase()));
25
26
  return l ? p(n, "title") : n;
26
- }, [e, r, l]), x = v(
27
- () => i ? D(a, o, c, d) : j(a, o, c, d),
27
+ }, [t, r, l]), y = v(
28
+ () => i ? j(a, o, c, d) : E(a, o, c, d),
28
29
  [a, o, c, i, d]
29
30
  );
30
31
  return /* @__PURE__ */ s(
31
- y,
32
+ C,
32
33
  {
33
34
  "data-testid": "elevation",
34
35
  elevation: m ? 0 : 1,
35
- className: `${t.mainElevation}`,
36
- children: /* @__PURE__ */ h("div", { className: t.fullWidth, children: [
36
+ className: `${e.mainElevation}`,
37
+ children: /* @__PURE__ */ h("div", { className: e.fullWidth, children: [
37
38
  L && r.length > 0 && /* @__PURE__ */ h("span", { "data-testid": "search-bar-container", children: [
38
39
  m && /* @__PURE__ */ s(u, {}),
39
40
  /* @__PURE__ */ s(
40
- B,
41
+ D,
41
42
  {
42
- searchTerm: e,
43
- setSearchTerm: g,
44
- className: t.searchbar,
43
+ searchTerm: t,
44
+ setSearchTerm: x,
45
+ className: e.searchbar,
45
46
  placeholder: w
46
47
  }
47
48
  ),
@@ -49,11 +50,11 @@ const q = ({
49
50
  ] }),
50
51
  a.length === 0 && $,
51
52
  /* @__PURE__ */ s(
52
- C,
53
+ b,
53
54
  {
54
- "data-testid": "list",
55
- items: x,
56
- className: `${t.list} ${t.primaryText} ${i ? "" : t.roundedBottom}`,
55
+ "data-testid": g,
56
+ items: y,
57
+ className: `${e.list} ${e.primaryText} ${i ? "" : e.roundedBottom}`,
57
58
  style: { maxHeight: T },
58
59
  showDivider: !1
59
60
  }
@@ -63,5 +64,5 @@ const q = ({
63
64
  );
64
65
  };
65
66
  export {
66
- q as ListArea
67
+ z as ListArea
67
68
  };
@@ -2,7 +2,7 @@ import { jsx as r, Fragment as i } from "react/jsx-runtime";
2
2
  import { c as p } from "../../index.es-D54RuMc_.js";
3
3
  import { a as s, s as a, f as u } from "../../react.esm-CX1WJ2Pp.js";
4
4
  import { ListArea as c } from "./ListArea.js";
5
- import { g as h } from "../../ListAreaService-Wq9IkwWN.js";
5
+ import { g as h } from "../../ListAreaService-BVtuBN0K.js";
6
6
  import { d as m, t as n, g as t } from "../../vi.CjhMlMwf-CKxPQtd6.js";
7
7
  m("ListArea Test", () => {
8
8
  const o = [
@@ -4,7 +4,7 @@ import "../../index.es-3043KTnb.js";
4
4
  import "../../index.es-D54RuMc_.js";
5
5
  import "../Iconify/Iconify.js";
6
6
  import "../../enums/AvailableCustomIcons.js";
7
- import { g as a, a as g, m as d } from "../../ListAreaService-Wq9IkwWN.js";
7
+ import { g as a, a as g, m as d } from "../../ListAreaService-BVtuBN0K.js";
8
8
  export {
9
9
  a as getGroupedItems,
10
10
  g as getListedItems,
@@ -1,12 +1,12 @@
1
- import { jsx as n, Fragment as a } from "react/jsx-runtime";
1
+ import { jsx as n, Fragment as d } from "react/jsx-runtime";
2
2
  import { a as o, s as e } from "../../react.esm-CX1WJ2Pp.js";
3
- import { OnboardingBanner as s } from "./OnboardingBanner.js";
4
- import { d, t as i, a as r, g as t } from "../../vi.CjhMlMwf-CKxPQtd6.js";
5
- d("Onboarding Banner Test", () => {
6
- i("render OnboardingBanner with headline & description text", () => {
3
+ import { OnboardingBanner as i } from "./OnboardingBanner.js";
4
+ import { d as a, t as s, a as r, g as t } from "../../vi.CjhMlMwf-CKxPQtd6.js";
5
+ a("Onboarding Banner Test", () => {
6
+ s("render OnboardingBanner with headline & description text", () => {
7
7
  o(
8
8
  /* @__PURE__ */ n(
9
- s,
9
+ i,
10
10
  {
11
11
  headline: "test",
12
12
  description: "test description",
@@ -15,56 +15,56 @@ d("Onboarding Banner Test", () => {
15
15
  }
16
16
  )
17
17
  ), t(e.getByText("test")).toBeInTheDocument(), t(e.getByText("test description")).toBeInTheDocument();
18
- }), i("render OnboardingBanner with media content", () => {
18
+ }), s("render OnboardingBanner with media content", () => {
19
19
  o(
20
20
  /* @__PURE__ */ n(
21
- s,
21
+ i,
22
22
  {
23
23
  headline: "test",
24
24
  description: "test description",
25
- mediaContent: /* @__PURE__ */ n(a, { children: "Element" }),
25
+ mediaContent: /* @__PURE__ */ n(d, { children: "Element" }),
26
26
  isVisible: !0,
27
27
  onClose: r.fn()
28
28
  }
29
29
  )
30
30
  ), t(e.getByText("Element")).toBeInTheDocument();
31
- }), i("render OnboardingBanner with buttons", () => {
31
+ }), s("render OnboardingBanner with buttons", () => {
32
32
  o(
33
33
  /* @__PURE__ */ n(
34
- s,
34
+ i,
35
35
  {
36
36
  headline: "test",
37
37
  description: "test description",
38
38
  isVisible: !0,
39
39
  onClose: r.fn(),
40
- buttons: [{ label: "button-1" }, { label: "button-2" }]
40
+ buttons: [{ label: "button-1", id: "1" }, { label: "button-2", id: "2" }]
41
41
  }
42
42
  )
43
43
  ), t(e.getByText("button-1")).toBeInTheDocument(), t(e.getByText("button-2")).toBeInTheDocument(), t(e.queryByText("button-3")).not.toBeInTheDocument();
44
- }), i("calls onClose when close button is clicked", () => {
44
+ }), s("calls onClose when close button is clicked", () => {
45
45
  const l = r.fn();
46
46
  o(
47
47
  /* @__PURE__ */ n(
48
- s,
48
+ i,
49
49
  {
50
50
  headline: "test",
51
51
  description: "test description",
52
52
  isVisible: !0,
53
53
  onClose: l,
54
- buttons: [{ label: "button-1" }, { label: "button2" }]
54
+ buttons: [{ label: "button-1", id: "1" }, { label: "button-2", id: "2" }]
55
55
  }
56
56
  )
57
57
  ), e.getByTestId("onboarding-banner-close-button").click(), t(l).toHaveBeenCalledTimes(1);
58
- }), i("renders nothing when isVisibility is false", () => {
58
+ }), s("renders nothing when isVisibility is false", () => {
59
59
  o(
60
60
  /* @__PURE__ */ n(
61
- s,
61
+ i,
62
62
  {
63
63
  headline: "test",
64
64
  description: "test description",
65
65
  isVisible: !1,
66
66
  onClose: r.fn(),
67
- buttons: [{ label: "button-1" }, { label: "button-2" }]
67
+ buttons: [{ label: "button-1", id: "1" }, { label: "button-2", id: "2" }]
68
68
  }
69
69
  )
70
70
  ), t(e.queryByText("test")).not.toBeInTheDocument();
@@ -95,4 +95,8 @@ export type ListElement = Omit<BaseListElement, 'component'> & {
95
95
  * a custom class name for the list item
96
96
  */
97
97
  listItemClassName?: string;
98
+ /**
99
+ * data-testid for testing
100
+ */
101
+ 'data-testid'?: string;
98
102
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hortiview/shared-components",
3
3
  "description": "This is a shared component library. It should used in the HortiView platform and its modules.",
4
- "version": "2.1.0",
4
+ "version": "2.2.0",
5
5
  "type": "module",
6
6
  "repository": "https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared",
7
7
  "author": "Falk Menge <falk.menge.ext@bayer.com>",