@simplysm/solid 13.0.71 → 13.0.74
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/README.md +209 -202
- package/dist/components/data/calendar/Calendar.d.ts.map +1 -1
- package/dist/components/data/calendar/Calendar.js +3 -11
- package/dist/components/data/calendar/Calendar.js.map +2 -2
- package/dist/components/data/sheet/DataSheet.d.ts.map +1 -1
- package/dist/components/data/sheet/DataSheet.js +13 -16
- package/dist/components/data/sheet/DataSheet.js.map +2 -2
- package/dist/components/data/sheet/DataSheet.styles.d.ts.map +1 -1
- package/dist/components/data/sheet/DataSheet.styles.js +1 -1
- package/dist/components/data/sheet/DataSheet.styles.js.map +1 -1
- package/dist/components/data/sheet/DataSheetConfigDialog.d.ts.map +1 -1
- package/dist/components/data/sheet/DataSheetConfigDialog.js +27 -9
- package/dist/components/data/sheet/DataSheetConfigDialog.js.map +2 -2
- package/dist/components/disclosure/Dialog.d.ts +1 -1
- package/dist/components/disclosure/Dialog.d.ts.map +1 -1
- package/dist/components/disclosure/Dialog.js +5 -5
- package/dist/components/disclosure/Dialog.js.map +2 -2
- package/dist/components/disclosure/dialogZIndex.d.ts +1 -1
- package/dist/components/features/crud-detail/CrudDetail.js +23 -23
- package/dist/components/features/crud-detail/CrudDetail.js.map +2 -2
- package/dist/components/features/crud-sheet/CrudSheet.js +49 -49
- package/dist/components/features/crud-sheet/CrudSheet.js.map +2 -2
- package/dist/components/features/crud-sheet/types.d.ts +4 -4
- package/dist/components/features/crud-sheet/types.d.ts.map +1 -1
- package/dist/components/features/data-select-button/DataSelectButton.d.ts +25 -7
- package/dist/components/features/data-select-button/DataSelectButton.d.ts.map +1 -1
- package/dist/components/features/data-select-button/DataSelectButton.js +27 -12
- package/dist/components/features/data-select-button/DataSelectButton.js.map +2 -2
- package/dist/components/features/permission-table/PermissionTable.js +4 -4
- package/dist/components/features/permission-table/PermissionTable.js.map +2 -2
- package/dist/components/features/shared-data/SharedDataSelect.d.ts +22 -10
- package/dist/components/features/shared-data/SharedDataSelect.d.ts.map +1 -1
- package/dist/components/features/shared-data/SharedDataSelect.js +113 -29
- package/dist/components/features/shared-data/SharedDataSelect.js.map +2 -2
- package/dist/components/features/shared-data/SharedDataSelectButton.d.ts +3 -3
- package/dist/components/features/shared-data/SharedDataSelectButton.d.ts.map +1 -1
- package/dist/components/features/shared-data/SharedDataSelectButton.js.map +1 -1
- package/dist/components/features/shared-data/SharedDataSelectList.js +5 -4
- package/dist/components/features/shared-data/SharedDataSelectList.js.map +2 -2
- package/dist/components/feedback/notification/NotificationBanner.js +3 -3
- package/dist/components/feedback/notification/NotificationBanner.js.map +2 -2
- package/dist/components/feedback/notification/NotificationBell.d.ts.map +1 -1
- package/dist/components/feedback/notification/NotificationBell.js +12 -5
- package/dist/components/feedback/notification/NotificationBell.js.map +2 -2
- package/dist/components/feedback/notification/NotificationProvider.d.ts.map +1 -1
- package/dist/components/feedback/notification/NotificationProvider.js +3 -1
- package/dist/components/feedback/notification/NotificationProvider.js.map +2 -2
- package/dist/components/form-control/ThemeToggle.d.ts.map +1 -1
- package/dist/components/form-control/ThemeToggle.js +9 -6
- package/dist/components/form-control/ThemeToggle.js.map +2 -2
- package/dist/components/form-control/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/form-control/checkbox/Checkbox.js +3 -1
- package/dist/components/form-control/checkbox/Checkbox.js.map +2 -2
- package/dist/components/form-control/checkbox/CheckboxGroup.js +1 -1
- package/dist/components/form-control/checkbox/CheckboxGroup.js.map +2 -2
- package/dist/components/form-control/checkbox/Radio.d.ts.map +1 -1
- package/dist/components/form-control/checkbox/Radio.js +3 -1
- package/dist/components/form-control/checkbox/Radio.js.map +2 -2
- package/dist/components/form-control/checkbox/RadioGroup.js +1 -1
- package/dist/components/form-control/checkbox/RadioGroup.js.map +2 -2
- package/dist/components/form-control/color-picker/ColorPicker.d.ts.map +1 -1
- package/dist/components/form-control/color-picker/ColorPicker.js +3 -1
- package/dist/components/form-control/color-picker/ColorPicker.js.map +2 -2
- package/dist/components/form-control/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/form-control/combobox/Combobox.js +9 -5
- package/dist/components/form-control/combobox/Combobox.js.map +2 -2
- package/dist/components/form-control/date-range-picker/DateRangePicker.js +9 -9
- package/dist/components/form-control/date-range-picker/DateRangePicker.js.map +2 -2
- package/dist/components/form-control/editor/EditorToolbar.js +3 -3
- package/dist/components/form-control/editor/EditorToolbar.js.map +2 -2
- package/dist/components/form-control/field/DatePicker.d.ts.map +1 -1
- package/dist/components/form-control/field/DatePicker.js +9 -3
- package/dist/components/form-control/field/DatePicker.js.map +2 -2
- package/dist/components/form-control/field/DateTimePicker.d.ts.map +1 -1
- package/dist/components/form-control/field/DateTimePicker.js +9 -3
- package/dist/components/form-control/field/DateTimePicker.js.map +2 -2
- package/dist/components/form-control/field/NumberInput.d.ts.map +1 -1
- package/dist/components/form-control/field/NumberInput.js +9 -3
- package/dist/components/form-control/field/NumberInput.js.map +2 -2
- package/dist/components/form-control/field/TextInput.d.ts.map +1 -1
- package/dist/components/form-control/field/TextInput.js +10 -4
- package/dist/components/form-control/field/TextInput.js.map +2 -2
- package/dist/components/form-control/field/Textarea.d.ts.map +1 -1
- package/dist/components/form-control/field/Textarea.js +9 -3
- package/dist/components/form-control/field/Textarea.js.map +2 -2
- package/dist/components/form-control/field/TimePicker.d.ts.map +1 -1
- package/dist/components/form-control/field/TimePicker.js +9 -3
- package/dist/components/form-control/field/TimePicker.js.map +2 -2
- package/dist/components/form-control/numpad/Numpad.d.ts.map +1 -1
- package/dist/components/form-control/numpad/Numpad.js +5 -1
- package/dist/components/form-control/numpad/Numpad.js.map +2 -2
- package/dist/components/form-control/select/Select.js +7 -7
- package/dist/components/form-control/select/Select.js.map +2 -2
- package/dist/components/form-control/state-preset/StatePreset.d.ts.map +1 -1
- package/dist/components/form-control/state-preset/StatePreset.js +42 -20
- package/dist/components/form-control/state-preset/StatePreset.js.map +2 -2
- package/dist/components/layout/sidebar/SidebarContainer.js +3 -3
- package/dist/components/layout/sidebar/SidebarContainer.js.map +2 -2
- package/dist/components/layout/sidebar/SidebarMenu.d.ts.map +1 -1
- package/dist/components/layout/sidebar/SidebarMenu.js +5 -2
- package/dist/components/layout/sidebar/SidebarMenu.js.map +2 -2
- package/dist/components/layout/topbar/Topbar.js +3 -4
- package/dist/components/layout/topbar/Topbar.js.map +2 -2
- package/dist/components/layout/topbar/TopbarMenu.js +3 -3
- package/dist/components/layout/topbar/TopbarMenu.js.map +2 -2
- package/dist/hooks/createSelectionGroup.d.ts +2 -2
- package/dist/hooks/createSelectionGroup.d.ts.map +1 -1
- package/dist/hooks/createSelectionGroup.js +5 -2
- package/dist/hooks/createSelectionGroup.js.map +2 -2
- package/dist/providers/i18n/I18nContext.d.ts +0 -4
- package/dist/providers/i18n/I18nContext.d.ts.map +1 -1
- package/dist/providers/i18n/I18nContext.js +1 -5
- package/dist/providers/i18n/I18nContext.js.map +2 -2
- package/dist/providers/i18n/locales/en.d.ts +38 -0
- package/dist/providers/i18n/locales/en.d.ts.map +1 -1
- package/dist/providers/i18n/locales/en.js +39 -1
- package/dist/providers/i18n/locales/en.js.map +1 -1
- package/dist/providers/i18n/locales/ko.d.ts +38 -0
- package/dist/providers/i18n/locales/ko.d.ts.map +1 -1
- package/dist/providers/i18n/locales/ko.js +39 -1
- package/dist/providers/i18n/locales/ko.js.map +1 -1
- package/package.json +6 -6
- package/src/components/data/calendar/Calendar.tsx +3 -4
- package/src/components/data/sheet/DataSheet.styles.ts +1 -1
- package/src/components/data/sheet/DataSheet.tsx +14 -15
- package/src/components/data/sheet/DataSheetConfigDialog.tsx +12 -10
- package/src/components/data/sheet/types.ts +1 -1
- package/src/components/disclosure/Dialog.tsx +10 -10
- package/src/components/disclosure/dialogZIndex.ts +1 -1
- package/src/components/features/crud-detail/CrudDetail.tsx +25 -25
- package/src/components/features/crud-sheet/CrudSheet.tsx +53 -53
- package/src/components/features/crud-sheet/types.ts +4 -4
- package/src/components/features/data-select-button/DataSelectButton.tsx +51 -21
- package/src/components/features/permission-table/PermissionTable.tsx +3 -3
- package/src/components/features/shared-data/SharedDataSelect.tsx +172 -33
- package/src/components/features/shared-data/SharedDataSelectButton.tsx +3 -2
- package/src/components/features/shared-data/SharedDataSelectList.tsx +4 -4
- package/src/components/feedback/notification/NotificationBanner.tsx +3 -3
- package/src/components/feedback/notification/NotificationBell.tsx +6 -4
- package/src/components/feedback/notification/NotificationProvider.tsx +3 -1
- package/src/components/form-control/ThemeToggle.tsx +10 -6
- package/src/components/form-control/checkbox/Checkbox.tsx +4 -1
- package/src/components/form-control/checkbox/CheckboxGroup.tsx +1 -1
- package/src/components/form-control/checkbox/Radio.tsx +4 -1
- package/src/components/form-control/checkbox/RadioGroup.tsx +1 -1
- package/src/components/form-control/color-picker/ColorPicker.tsx +4 -1
- package/src/components/form-control/combobox/Combobox.tsx +6 -3
- package/src/components/form-control/date-range-picker/DateRangePicker.tsx +8 -8
- package/src/components/form-control/editor/EditorToolbar.tsx +23 -23
- package/src/components/form-control/field/DatePicker.tsx +6 -3
- package/src/components/form-control/field/DateTimePicker.tsx +6 -3
- package/src/components/form-control/field/NumberInput.tsx +6 -3
- package/src/components/form-control/field/TextInput.tsx +7 -4
- package/src/components/form-control/field/Textarea.tsx +6 -3
- package/src/components/form-control/field/TimePicker.tsx +6 -3
- package/src/components/form-control/numpad/Numpad.tsx +3 -1
- package/src/components/form-control/select/Select.tsx +7 -7
- package/src/components/form-control/state-preset/StatePreset.tsx +14 -12
- package/src/components/layout/sidebar/SidebarContainer.tsx +3 -3
- package/src/components/layout/sidebar/SidebarMenu.tsx +3 -1
- package/src/components/layout/topbar/Topbar.tsx +3 -3
- package/src/components/layout/topbar/TopbarMenu.tsx +3 -3
- package/src/hooks/createSelectionGroup.tsx +8 -4
- package/src/providers/i18n/I18nContext.tsx +0 -7
- package/src/providers/i18n/locales/en.ts +38 -0
- package/src/providers/i18n/locales/ko.ts +38 -0
- package/tailwind.config.ts +2 -2
- package/tests/components/data/kanban/Kanban.selection.spec.tsx +34 -24
- package/tests/components/disclosure/Dialog.spec.tsx +28 -28
- package/tests/components/disclosure/DialogProvider.spec.tsx +51 -25
- package/tests/components/features/address/AddressSearch.spec.tsx +12 -4
- package/tests/components/features/crud-detail/CrudDetail.spec.tsx +1 -0
- package/tests/components/features/crud-sheet/CrudSheet.spec.tsx +30 -6
- package/tests/components/features/data-select-button/DataSelectButton.spec.tsx +77 -56
- package/tests/components/features/permission-table/PermissionTable.spec.tsx +12 -8
- package/tests/components/features/shared-data/SharedDataSelect.spec.tsx +172 -0
- package/tests/components/features/shared-data/SharedDataSelectList.spec.tsx +14 -2
- package/tests/components/feedback/notification/LiveRegion.spec.tsx +20 -9
- package/tests/components/feedback/notification/NotificationBanner.spec.tsx +64 -46
- package/tests/components/feedback/notification/NotificationBell.spec.tsx +70 -51
- package/tests/components/feedback/notification/NotificationContext.spec.tsx +105 -78
- package/tests/components/form-control/checkbox/Checkbox.spec.tsx +25 -20
- package/tests/components/form-control/checkbox/CheckboxGroup.spec.tsx +53 -30
- package/tests/components/form-control/checkbox/Radio.spec.tsx +25 -20
- package/tests/components/form-control/checkbox/RadioGroup.spec.tsx +53 -30
- package/tests/components/form-control/color-picker/ColorPicker.spec.tsx +24 -15
- package/tests/components/form-control/combobox/Combobox.spec.tsx +92 -59
- package/tests/components/form-control/date-range-picker/DateRangePicker.spec.tsx +2 -2
- package/tests/components/form-control/field/DatePicker.spec.tsx +50 -44
- package/tests/components/form-control/field/DateTimePicker.spec.tsx +51 -45
- package/tests/components/form-control/field/NumberInput.spec.tsx +53 -47
- package/tests/components/form-control/field/TextInput.spec.tsx +50 -44
- package/tests/components/form-control/field/Textarea.spec.tsx +35 -29
- package/tests/components/form-control/field/TimePicker.spec.tsx +43 -37
- package/tests/components/form-control/numpad/Numpad.spec.tsx +175 -25
- package/tests/components/form-control/select/Select.spec.tsx +5 -0
- package/tests/components/form-control/select/SelectItem.spec.tsx +1 -0
- package/tests/components/layout/sidebar/Sidebar.spec.tsx +79 -35
- package/tests/components/layout/sidebar/SidebarContainer.spec.tsx +1 -0
- package/tests/components/layout/sidebar/SidebarMenu.spec.tsx +28 -17
- package/tests/components/layout/topbar/TopbarActions.spec.tsx +41 -23
- package/tests/components/layout/topbar/createTopbarActions.spec.tsx +1 -0
- package/tests/hooks/usePrint.spec.tsx +1 -1
- package/tests/hooks/useRouterLink.spec.tsx +2 -0
- package/tests/hooks/useSyncConfig.spec.tsx +1 -0
- package/tests/providers/ErrorLoggerProvider.spec.tsx +1 -0
- package/tests/providers/PwaUpdateProvider.spec.tsx +16 -6
- package/tests/providers/ServiceClientContext.spec.tsx +40 -25
- package/tests/providers/i18n/I18nContext.spec.tsx +3 -4
- package/tests/providers/shared-data/SharedDataProvider.spec.tsx +2 -0
- package/dist/hooks/usePrint.d.ts +0 -3
- package/dist/hooks/usePrint.d.ts.map +0 -1
- package/dist/hooks/usePrint.js +0 -5
- package/dist/hooks/usePrint.js.map +0 -6
- package/src/hooks/usePrint.ts +0 -2
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { render, waitFor } from "@solidjs/testing-library";
|
|
2
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { describe, it, expect, beforeEach } from "vitest";
|
|
3
3
|
import { NotificationProvider } from "../../../../src/components/feedback/notification/NotificationProvider";
|
|
4
4
|
import { ConfigContext } from "../../../../src/providers/ConfigContext";
|
|
5
|
+
import { I18nProvider } from "../../../../src/providers/i18n/I18nContext";
|
|
5
6
|
import { useNotification } from "../../../../src/components/feedback/notification/NotificationContext";
|
|
6
7
|
|
|
7
8
|
describe("Notification Live Region", () => {
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
localStorage.setItem("testApp.i18n-locale", JSON.stringify("en"));
|
|
11
|
+
});
|
|
12
|
+
|
|
8
13
|
it("Provider has live region with role=status", () => {
|
|
9
14
|
render(() => (
|
|
10
15
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
11
|
-
<
|
|
16
|
+
<I18nProvider>
|
|
17
|
+
<NotificationProvider>content</NotificationProvider>
|
|
18
|
+
</I18nProvider>
|
|
12
19
|
</ConfigContext.Provider>
|
|
13
20
|
));
|
|
14
21
|
|
|
@@ -21,12 +28,14 @@ describe("Notification Live Region", () => {
|
|
|
21
28
|
|
|
22
29
|
render(() => (
|
|
23
30
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
<I18nProvider>
|
|
32
|
+
<NotificationProvider>
|
|
33
|
+
{(() => {
|
|
34
|
+
notification = useNotification();
|
|
35
|
+
return null;
|
|
36
|
+
})()}
|
|
37
|
+
</NotificationProvider>
|
|
38
|
+
</I18nProvider>
|
|
30
39
|
</ConfigContext.Provider>
|
|
31
40
|
));
|
|
32
41
|
|
|
@@ -42,7 +51,9 @@ describe("Notification Live Region", () => {
|
|
|
42
51
|
it("live region is visually hidden (sr-only)", () => {
|
|
43
52
|
render(() => (
|
|
44
53
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
45
|
-
<
|
|
54
|
+
<I18nProvider>
|
|
55
|
+
<NotificationProvider>content</NotificationProvider>
|
|
56
|
+
</I18nProvider>
|
|
46
57
|
</ConfigContext.Provider>
|
|
47
58
|
));
|
|
48
59
|
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { render, fireEvent, waitFor } from "@solidjs/testing-library";
|
|
2
|
-
import { describe, it, expect, vi } from "vitest";
|
|
2
|
+
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
3
3
|
import { NotificationProvider } from "../../../../src/components/feedback/notification/NotificationProvider";
|
|
4
4
|
import { ConfigContext } from "../../../../src/providers/ConfigContext";
|
|
5
|
+
import { I18nProvider } from "../../../../src/providers/i18n/I18nContext";
|
|
5
6
|
import { NotificationBanner } from "../../../../src/components/feedback/notification/NotificationBanner";
|
|
6
7
|
import { useNotification } from "../../../../src/components/feedback/notification/NotificationContext";
|
|
7
8
|
|
|
8
9
|
describe("NotificationBanner", () => {
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
localStorage.setItem("testApp.i18n-locale", JSON.stringify("en"));
|
|
12
|
+
});
|
|
9
13
|
it("does not display banner when no notification", () => {
|
|
10
14
|
const { container } = render(() => (
|
|
11
15
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
|
|
16
|
+
<I18nProvider>
|
|
17
|
+
<NotificationProvider>
|
|
18
|
+
<NotificationBanner />
|
|
19
|
+
</NotificationProvider>
|
|
20
|
+
</I18nProvider>
|
|
15
21
|
</ConfigContext.Provider>
|
|
16
22
|
));
|
|
17
23
|
|
|
@@ -23,13 +29,15 @@ describe("NotificationBanner", () => {
|
|
|
23
29
|
|
|
24
30
|
render(() => (
|
|
25
31
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
<I18nProvider>
|
|
33
|
+
<NotificationProvider>
|
|
34
|
+
{(() => {
|
|
35
|
+
notification = useNotification();
|
|
36
|
+
return null;
|
|
37
|
+
})()}
|
|
38
|
+
<NotificationBanner />
|
|
39
|
+
</NotificationProvider>
|
|
40
|
+
</I18nProvider>
|
|
33
41
|
</ConfigContext.Provider>
|
|
34
42
|
));
|
|
35
43
|
|
|
@@ -48,13 +56,15 @@ describe("NotificationBanner", () => {
|
|
|
48
56
|
|
|
49
57
|
render(() => (
|
|
50
58
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
<I18nProvider>
|
|
60
|
+
<NotificationProvider>
|
|
61
|
+
{(() => {
|
|
62
|
+
notification = useNotification();
|
|
63
|
+
return null;
|
|
64
|
+
})()}
|
|
65
|
+
<NotificationBanner />
|
|
66
|
+
</NotificationProvider>
|
|
67
|
+
</I18nProvider>
|
|
58
68
|
</ConfigContext.Provider>
|
|
59
69
|
));
|
|
60
70
|
|
|
@@ -79,13 +89,15 @@ describe("NotificationBanner", () => {
|
|
|
79
89
|
|
|
80
90
|
render(() => (
|
|
81
91
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
<I18nProvider>
|
|
93
|
+
<NotificationProvider>
|
|
94
|
+
{(() => {
|
|
95
|
+
notification = useNotification();
|
|
96
|
+
return null;
|
|
97
|
+
})()}
|
|
98
|
+
<NotificationBanner />
|
|
99
|
+
</NotificationProvider>
|
|
100
|
+
</I18nProvider>
|
|
89
101
|
</ConfigContext.Provider>
|
|
90
102
|
));
|
|
91
103
|
|
|
@@ -102,13 +114,15 @@ describe("NotificationBanner", () => {
|
|
|
102
114
|
|
|
103
115
|
render(() => (
|
|
104
116
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
117
|
+
<I18nProvider>
|
|
118
|
+
<NotificationProvider>
|
|
119
|
+
{(() => {
|
|
120
|
+
notification = useNotification();
|
|
121
|
+
return null;
|
|
122
|
+
})()}
|
|
123
|
+
<NotificationBanner />
|
|
124
|
+
</NotificationProvider>
|
|
125
|
+
</I18nProvider>
|
|
112
126
|
</ConfigContext.Provider>
|
|
113
127
|
));
|
|
114
128
|
|
|
@@ -126,13 +140,15 @@ describe("NotificationBanner", () => {
|
|
|
126
140
|
|
|
127
141
|
render(() => (
|
|
128
142
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
143
|
+
<I18nProvider>
|
|
144
|
+
<NotificationProvider>
|
|
145
|
+
{(() => {
|
|
146
|
+
notification = useNotification();
|
|
147
|
+
return null;
|
|
148
|
+
})()}
|
|
149
|
+
<NotificationBanner />
|
|
150
|
+
</NotificationProvider>
|
|
151
|
+
</I18nProvider>
|
|
136
152
|
</ConfigContext.Provider>
|
|
137
153
|
));
|
|
138
154
|
|
|
@@ -160,13 +176,15 @@ describe("NotificationBanner", () => {
|
|
|
160
176
|
|
|
161
177
|
render(() => (
|
|
162
178
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
163
|
-
<
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
179
|
+
<I18nProvider>
|
|
180
|
+
<NotificationProvider>
|
|
181
|
+
{(() => {
|
|
182
|
+
notification = useNotification();
|
|
183
|
+
return null;
|
|
184
|
+
})()}
|
|
185
|
+
<NotificationBanner />
|
|
186
|
+
</NotificationProvider>
|
|
187
|
+
</I18nProvider>
|
|
170
188
|
</ConfigContext.Provider>
|
|
171
189
|
));
|
|
172
190
|
|
|
@@ -2,6 +2,7 @@ import { render, fireEvent, waitFor } from "@solidjs/testing-library";
|
|
|
2
2
|
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
|
3
3
|
import { NotificationProvider } from "../../../../src/components/feedback/notification/NotificationProvider";
|
|
4
4
|
import { ConfigContext } from "../../../../src/providers/ConfigContext";
|
|
5
|
+
import { I18nProvider } from "../../../../src/providers/i18n/I18nContext";
|
|
5
6
|
import { NotificationBell } from "../../../../src/components/feedback/notification/NotificationBell";
|
|
6
7
|
import { useNotification } from "../../../../src/components/feedback/notification/NotificationContext";
|
|
7
8
|
|
|
@@ -18,9 +19,11 @@ describe("NotificationBell", () => {
|
|
|
18
19
|
it("renders button", () => {
|
|
19
20
|
const { container } = render(() => (
|
|
20
21
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
22
|
+
<I18nProvider>
|
|
23
|
+
<NotificationProvider>
|
|
24
|
+
<NotificationBell />
|
|
25
|
+
</NotificationProvider>
|
|
26
|
+
</I18nProvider>
|
|
24
27
|
</ConfigContext.Provider>
|
|
25
28
|
));
|
|
26
29
|
|
|
@@ -30,9 +33,11 @@ describe("NotificationBell", () => {
|
|
|
30
33
|
it("does not show badge when there are no notifications", () => {
|
|
31
34
|
render(() => (
|
|
32
35
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
+
<I18nProvider>
|
|
37
|
+
<NotificationProvider>
|
|
38
|
+
<NotificationBell />
|
|
39
|
+
</NotificationProvider>
|
|
40
|
+
</I18nProvider>
|
|
36
41
|
</ConfigContext.Provider>
|
|
37
42
|
));
|
|
38
43
|
|
|
@@ -45,13 +50,15 @@ describe("NotificationBell", () => {
|
|
|
45
50
|
|
|
46
51
|
render(() => (
|
|
47
52
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
<I18nProvider>
|
|
54
|
+
<NotificationProvider>
|
|
55
|
+
{(() => {
|
|
56
|
+
notification = useNotification();
|
|
57
|
+
return null;
|
|
58
|
+
})()}
|
|
59
|
+
<NotificationBell />
|
|
60
|
+
</NotificationProvider>
|
|
61
|
+
</I18nProvider>
|
|
55
62
|
</ConfigContext.Provider>
|
|
56
63
|
));
|
|
57
64
|
|
|
@@ -69,13 +76,15 @@ describe("NotificationBell", () => {
|
|
|
69
76
|
|
|
70
77
|
render(() => (
|
|
71
78
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
<I18nProvider>
|
|
80
|
+
<NotificationProvider>
|
|
81
|
+
{(() => {
|
|
82
|
+
notification = useNotification();
|
|
83
|
+
return null;
|
|
84
|
+
})()}
|
|
85
|
+
<NotificationBell />
|
|
86
|
+
</NotificationProvider>
|
|
87
|
+
</I18nProvider>
|
|
79
88
|
</ConfigContext.Provider>
|
|
80
89
|
));
|
|
81
90
|
|
|
@@ -95,13 +104,15 @@ describe("NotificationBell", () => {
|
|
|
95
104
|
|
|
96
105
|
render(() => (
|
|
97
106
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
<I18nProvider>
|
|
108
|
+
<NotificationProvider>
|
|
109
|
+
{(() => {
|
|
110
|
+
notification = useNotification();
|
|
111
|
+
return null;
|
|
112
|
+
})()}
|
|
113
|
+
<NotificationBell />
|
|
114
|
+
</NotificationProvider>
|
|
115
|
+
</I18nProvider>
|
|
105
116
|
</ConfigContext.Provider>
|
|
106
117
|
));
|
|
107
118
|
|
|
@@ -123,13 +134,15 @@ describe("NotificationBell", () => {
|
|
|
123
134
|
|
|
124
135
|
render(() => (
|
|
125
136
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
137
|
+
<I18nProvider>
|
|
138
|
+
<NotificationProvider>
|
|
139
|
+
{(() => {
|
|
140
|
+
notification = useNotification();
|
|
141
|
+
return null;
|
|
142
|
+
})()}
|
|
143
|
+
<NotificationBell />
|
|
144
|
+
</NotificationProvider>
|
|
145
|
+
</I18nProvider>
|
|
133
146
|
</ConfigContext.Provider>
|
|
134
147
|
));
|
|
135
148
|
|
|
@@ -144,9 +157,11 @@ describe("NotificationBell", () => {
|
|
|
144
157
|
it("sets aria-haspopup and aria-expanded correctly", async () => {
|
|
145
158
|
render(() => (
|
|
146
159
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
147
|
-
<
|
|
148
|
-
<
|
|
149
|
-
|
|
160
|
+
<I18nProvider>
|
|
161
|
+
<NotificationProvider>
|
|
162
|
+
<NotificationBell />
|
|
163
|
+
</NotificationProvider>
|
|
164
|
+
</I18nProvider>
|
|
150
165
|
</ConfigContext.Provider>
|
|
151
166
|
));
|
|
152
167
|
|
|
@@ -166,13 +181,15 @@ describe("NotificationBell", () => {
|
|
|
166
181
|
|
|
167
182
|
render(() => (
|
|
168
183
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
169
|
-
<
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
184
|
+
<I18nProvider>
|
|
185
|
+
<NotificationProvider>
|
|
186
|
+
{(() => {
|
|
187
|
+
notification = useNotification();
|
|
188
|
+
return null;
|
|
189
|
+
})()}
|
|
190
|
+
<NotificationBell />
|
|
191
|
+
</NotificationProvider>
|
|
192
|
+
</I18nProvider>
|
|
176
193
|
</ConfigContext.Provider>
|
|
177
194
|
));
|
|
178
195
|
|
|
@@ -196,13 +213,15 @@ describe("NotificationBell", () => {
|
|
|
196
213
|
|
|
197
214
|
render(() => (
|
|
198
215
|
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
216
|
+
<I18nProvider>
|
|
217
|
+
<NotificationProvider>
|
|
218
|
+
{(() => {
|
|
219
|
+
notification = useNotification();
|
|
220
|
+
return null;
|
|
221
|
+
})()}
|
|
222
|
+
<NotificationBell />
|
|
223
|
+
</NotificationProvider>
|
|
224
|
+
</I18nProvider>
|
|
206
225
|
</ConfigContext.Provider>
|
|
207
226
|
));
|
|
208
227
|
|