@cerebruminc/cerebellum 20.3.0 → 20.3.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
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# react-component-lib-boilerplate
|
|
2
2
|
|
|
3
|
+
## [20.3.1](https://github.com/cerebruminc/cerebellum/compare/v20.3.0...v20.3.1) (2026-09-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **user-card:** expose organization control test ids ([1ed8321](https://github.com/cerebruminc/cerebellum/commit/1ed832131f23ca8d9b979e5e8fb586b4cdc4d385))
|
|
9
|
+
|
|
3
10
|
## [20.3.0](https://github.com/cerebruminc/cerebellum/compare/v20.2.1...v20.3.0) (2026-09-01)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED
|
@@ -41,6 +41,7 @@ const orgOptions = [
|
|
|
41
41
|
text: "Acme Limited",
|
|
42
42
|
onClick: ({ option }: { option: UserCardOptionsType }) => console.log("Set Acme Limited", option),
|
|
43
43
|
id: "1",
|
|
44
|
+
testId: "org-1",
|
|
44
45
|
},
|
|
45
46
|
{
|
|
46
47
|
Icon: User,
|
|
@@ -48,6 +49,7 @@ const orgOptions = [
|
|
|
48
49
|
text: "Universal Widgets",
|
|
49
50
|
onClick: ({ option }: { option: UserCardOptionsType }) => console.log("Set Universal Widgets", option),
|
|
50
51
|
id: "2",
|
|
52
|
+
testId: "org-2",
|
|
51
53
|
},
|
|
52
54
|
{
|
|
53
55
|
Icon: User,
|
|
@@ -55,6 +57,7 @@ const orgOptions = [
|
|
|
55
57
|
text: "Foo International",
|
|
56
58
|
onClick: ({ option }: { option: UserCardOptionsType }) => console.log("Foo International", option),
|
|
57
59
|
id: "3",
|
|
60
|
+
testId: "org-3",
|
|
58
61
|
},
|
|
59
62
|
];
|
|
60
63
|
|
|
@@ -85,6 +88,13 @@ describe("UserCard", () => {
|
|
|
85
88
|
expect(org2Text).toBeInTheDocument();
|
|
86
89
|
});
|
|
87
90
|
|
|
91
|
+
test("applies organization test ids to organization controls", () => {
|
|
92
|
+
render(<UserCard organizations={orgOptions} userEmail="foo" userName="bar" />);
|
|
93
|
+
|
|
94
|
+
expect(screen.getByTestId(orgOptions[0].testId as string)).toBeInTheDocument();
|
|
95
|
+
expect(screen.getByTestId(orgOptions[1].testId as string)).toBeInTheDocument();
|
|
96
|
+
});
|
|
97
|
+
|
|
88
98
|
test("filters organizations locally in uncontrolled mode", async () => {
|
|
89
99
|
render(
|
|
90
100
|
<UserCard
|
|
@@ -409,13 +409,14 @@ export const UserCard: FC<UserCardType> = ({
|
|
|
409
409
|
}
|
|
410
410
|
>
|
|
411
411
|
{displayedOrganizations?.map((option) => {
|
|
412
|
-
const { Icon, onClick, text, id } = option;
|
|
412
|
+
const { Icon, onClick, text, id, testId } = option;
|
|
413
413
|
const isActive = activeOrg === id;
|
|
414
414
|
const hasIcon = !!Icon;
|
|
415
415
|
|
|
416
416
|
return (
|
|
417
417
|
<div
|
|
418
418
|
key={id}
|
|
419
|
+
data-testid={testId}
|
|
419
420
|
className={clsx(
|
|
420
421
|
styles.organization,
|
|
421
422
|
isActive && interactiveOrgs && styles.organizationActive,
|