@carlonicora/nextjs-jsonapi 1.36.1 → 1.38.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/dist/{BlockNoteEditor-4MDHRUS2.js → BlockNoteEditor-3S2B36O3.js} +15 -15
- package/dist/{BlockNoteEditor-4MDHRUS2.js.map → BlockNoteEditor-3S2B36O3.js.map} +1 -1
- package/dist/{BlockNoteEditor-SZWO3MDO.mjs → BlockNoteEditor-WQUJTVJL.mjs} +5 -5
- package/dist/BlockNoteEditor-WQUJTVJL.mjs.map +1 -0
- package/dist/billing/index.d.mts +15 -5
- package/dist/billing/index.d.ts +15 -5
- package/dist/billing/index.js +750 -520
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +665 -435
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-53IPQJVH.js → chunk-3EZX4G2E.js} +147 -23
- package/dist/chunk-3EZX4G2E.js.map +1 -0
- package/dist/{chunk-I7DFEJFF.mjs → chunk-4PHADEKA.mjs} +738 -1418
- package/dist/chunk-4PHADEKA.mjs.map +1 -0
- package/dist/{chunk-E6PQQTWF.js → chunk-T2JCZYWK.js} +999 -1679
- package/dist/chunk-T2JCZYWK.js.map +1 -0
- package/dist/{chunk-P7R2DPD6.mjs → chunk-TQ5GRRTM.mjs} +125 -1
- package/dist/chunk-TQ5GRRTM.mjs.map +1 -0
- package/dist/client/index.js +3 -3
- package/dist/client/index.mjs +2 -2
- package/dist/components/index.d.mts +23 -8
- package/dist/components/index.d.ts +23 -8
- package/dist/components/index.js +3 -3
- package/dist/components/index.mjs +2 -2
- package/dist/contexts/index.d.mts +1 -1
- package/dist/contexts/index.d.ts +1 -1
- package/dist/contexts/index.js +3 -3
- package/dist/contexts/index.mjs +2 -2
- package/dist/core/index.d.mts +47 -3
- package/dist/core/index.d.ts +47 -3
- package/dist/core/index.js +8 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +7 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -1
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/dist/{stripe-subscription.interface-DK7BJaNd.d.ts → stripe-promotion-code.interface-BcJty0rv.d.ts} +18 -1
- package/dist/{stripe-subscription.interface-C8uhCYIZ.d.mts → stripe-promotion-code.interface-Dnm2DJKQ.d.mts} +18 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/billing/index.ts +1 -0
- package/src/client/context/JsonApiProvider.tsx +1 -5
- package/src/client/hooks/__tests__/useJsonApiGet.test.tsx +9 -9
- package/src/client/hooks/__tests__/useJsonApiMutation.test.tsx +11 -11
- package/src/client/hooks/__tests__/useRehydration.test.ts +13 -34
- package/src/components/editors/BlockNoteEditor.tsx +2 -2
- package/src/components/forms/CommonEditorTrigger.tsx +1 -1
- package/src/components/forms/FormCheckbox.tsx +2 -12
- package/src/components/forms/FormDate.tsx +1 -6
- package/src/components/forms/FormInput.tsx +1 -1
- package/src/components/forms/FormPassword.tsx +1 -7
- package/src/components/forms/FormSelect.tsx +2 -8
- package/src/components/forms/FormSlider.tsx +1 -5
- package/src/components/forms/FormSwitch.tsx +1 -5
- package/src/components/forms/GdprConsentCheckbox.tsx +2 -8
- package/src/components/forms/PasswordInput.tsx +28 -26
- package/src/components/forms/__tests__/FormCheckbox.test.tsx +16 -18
- package/src/components/forms/__tests__/FormDate.test.tsx +14 -30
- package/src/components/forms/__tests__/FormInput.test.tsx +21 -37
- package/src/components/forms/__tests__/FormSelect.test.tsx +15 -21
- package/src/components/tables/ContentListTable.tsx +1 -1
- package/src/components/tables/__tests__/ContentListTable.test.tsx +17 -89
- package/src/components/tables/cells/cell.component.tsx +1 -1
- package/src/contexts/HeaderChildrenContext.tsx +3 -1
- package/src/core/endpoint/__tests__/EndpointCreator.test.ts +2 -7
- package/src/core/factories/__tests__/JsonApiDataFactory.test.ts +3 -3
- package/src/core/factories/__tests__/RehydrationFactory.test.ts +4 -6
- package/src/core/index.ts +1 -0
- package/src/core/registry/ModuleRegistry.ts +1 -0
- package/src/core/registry/__tests__/DataClassRegistry.test.ts +5 -15
- package/src/core/registry/__tests__/ModuleRegistrar.test.ts +5 -15
- package/src/features/auth/components/GdprConsentSection.tsx +1 -6
- package/src/features/auth/components/details/LandingComponent.tsx +6 -1
- package/src/features/auth/components/forms/AcceptInvitation.tsx +1 -1
- package/src/features/auth/components/forms/ResetPassword.tsx +1 -1
- package/src/features/billing/components/cards/PaymentMethodSummaryCard.tsx +13 -18
- package/src/features/billing/components/cards/SubscriptionSummaryCard.tsx +12 -17
- package/src/features/billing/components/modals/BillingDetailModal.tsx +2 -13
- package/src/features/billing/stripe-customer/components/details/PaymentMethodCard.tsx +8 -1
- package/src/features/billing/stripe-customer/components/forms/PaymentMethodEditor.tsx +2 -13
- package/src/features/billing/stripe-customer/components/forms/PaymentMethodForm.tsx +2 -12
- package/src/features/billing/stripe-invoice/components/details/InvoiceDetails.tsx +6 -1
- package/src/features/billing/stripe-invoice/data/stripe-invoice.interface.ts +1 -0
- package/src/features/billing/stripe-price/components/lists/PricesList.tsx +13 -5
- package/src/features/billing/stripe-product/components/lists/ProductsList.tsx +5 -5
- package/src/features/billing/stripe-promotion-code/components/PromoCodeInput.tsx +108 -0
- package/src/features/billing/stripe-promotion-code/components/index.ts +1 -0
- package/src/features/billing/stripe-promotion-code/data/index.ts +3 -0
- package/src/features/billing/stripe-promotion-code/data/stripe-promotion-code.interface.ts +14 -0
- package/src/features/billing/stripe-promotion-code/data/stripe-promotion-code.service.ts +64 -0
- package/src/features/billing/stripe-promotion-code/data/stripe-promotion-code.ts +66 -0
- package/src/features/billing/stripe-promotion-code/index.ts +2 -0
- package/src/features/billing/stripe-promotion-code/stripe-promotion-code.module.ts +9 -0
- package/src/features/billing/stripe-subscription/components/containers/SubscriptionsContainer.tsx +1 -3
- package/src/features/billing/stripe-subscription/components/details/SubscriptionDetails.tsx +4 -1
- package/src/features/billing/stripe-subscription/components/forms/CancelSubscriptionDialog.tsx +1 -1
- package/src/features/billing/stripe-subscription/components/lists/SubscriptionsList.tsx +24 -4
- package/src/features/billing/stripe-subscription/components/widgets/PricingCard.tsx +9 -2
- package/src/features/billing/stripe-subscription/components/widgets/SubscriptionStatusBadge.tsx +3 -1
- package/src/features/billing/stripe-subscription/components/wizards/SubscriptionWizard.tsx +7 -7
- package/src/features/billing/stripe-subscription/components/wizards/WizardProgressIndicator.tsx +2 -10
- package/src/features/billing/stripe-subscription/components/wizards/WizardStepPaymentMethod.tsx +3 -13
- package/src/features/billing/stripe-subscription/components/wizards/WizardStepReview.tsx +134 -23
- package/src/features/billing/stripe-subscription/data/stripe-subscription.interface.ts +2 -0
- package/src/features/billing/stripe-subscription/data/stripe-subscription.ts +8 -0
- package/src/features/billing/stripe-subscription/hooks/useSubscriptionWizard.ts +93 -7
- package/src/features/billing/stripe-usage/components/details/UsageSummaryCard.tsx +1 -1
- package/src/features/billing/stripe-usage/components/lists/UsageHistoryTable.tsx +1 -1
- package/src/features/company/components/details/CompanyDetails.tsx +2 -2
- package/src/features/company/components/forms/CompanyConfigurationSecurityForm.tsx +1 -1
- package/src/features/index.ts +1 -0
- package/src/features/notification/components/containers/NotificationsListContainer.tsx +1 -1
- package/src/features/notification/components/modals/NotificationModal.tsx +6 -2
- package/src/features/notification/contexts/NotificationContext.tsx +1 -3
- package/src/features/oauth/components/OAuthClientCard.tsx +15 -17
- package/src/features/oauth/components/OAuthClientDetail.tsx +7 -19
- package/src/features/oauth/components/OAuthClientForm.tsx +4 -13
- package/src/features/oauth/components/OAuthClientSecretDisplay.tsx +4 -20
- package/src/features/oauth/components/OAuthRedirectUriInput.tsx +5 -12
- package/src/features/oauth/components/OAuthScopeSelector.tsx +17 -23
- package/src/features/oauth/components/consent/OAuthConsentActions.tsx +3 -16
- package/src/features/oauth/components/consent/OAuthConsentHeader.tsx +3 -12
- package/src/features/oauth/components/consent/OAuthConsentScreen.tsx +5 -20
- package/src/features/oauth/components/consent/OAuthScopeList.tsx +3 -18
- package/src/features/onboarding/contexts/OnboardingContext.tsx +3 -3
- package/src/features/role/components/forms/FormRoles.tsx +1 -7
- package/src/features/user/components/containers/UserContainer.tsx +1 -1
- package/src/features/user/components/details/UserDetails.tsx +1 -1
- package/src/features/user/components/forms/UserDeleter.tsx +1 -1
- package/src/features/user/components/forms/UserEditor.tsx +1 -1
- package/src/features/user/components/forms/UserMultiSelect.tsx +7 -7
- package/src/features/user/components/lists/UserListInAdd.tsx +2 -2
- package/src/features/user/components/lists/UsersList.tsx +7 -1
- package/src/features/user/contexts/CurrentUserContext.tsx +36 -33
- package/src/hooks/__tests__/useDataListRetriever.test.ts +15 -21
- package/src/hooks/__tests__/useDebounce.test.ts +2 -7
- package/src/hooks/useCustomD3Graph.tsx +2 -2
- package/src/shadcnui/custom/multi-select.tsx +28 -2
- package/src/shadcnui/ui/accordion.tsx +21 -23
- package/src/shadcnui/ui/alert-dialog.tsx +45 -62
- package/src/shadcnui/ui/alert.tsx +25 -41
- package/src/shadcnui/ui/avatar.tsx +23 -36
- package/src/shadcnui/ui/badge.tsx +13 -11
- package/src/shadcnui/ui/breadcrumb.tsx +21 -55
- package/src/shadcnui/ui/button.tsx +17 -18
- package/src/shadcnui/ui/calendar.tsx +44 -93
- package/src/shadcnui/ui/carousel.tsx +72 -100
- package/src/shadcnui/ui/chart.tsx +102 -161
- package/src/shadcnui/ui/checkbox.tsx +8 -9
- package/src/shadcnui/ui/combobox.tsx +52 -83
- package/src/shadcnui/ui/command.tsx +43 -77
- package/src/shadcnui/ui/context-menu.tsx +47 -86
- package/src/shadcnui/ui/dialog.tsx +34 -60
- package/src/shadcnui/ui/drawer.tsx +32 -53
- package/src/shadcnui/ui/dropdown-menu.tsx +48 -65
- package/src/shadcnui/ui/field.tsx +39 -48
- package/src/shadcnui/ui/hover-card.tsx +9 -14
- package/src/shadcnui/ui/input-group.tsx +44 -55
- package/src/shadcnui/ui/input-otp.tsx +22 -26
- package/src/shadcnui/ui/input.tsx +6 -6
- package/src/shadcnui/ui/label.tsx +6 -6
- package/src/shadcnui/ui/navigation-menu.tsx +36 -60
- package/src/shadcnui/ui/popover.tsx +15 -38
- package/src/shadcnui/ui/progress.tsx +12 -29
- package/src/shadcnui/ui/radio-group.tsx +9 -15
- package/src/shadcnui/ui/resizable.tsx +14 -24
- package/src/shadcnui/ui/scroll-area.tsx +12 -27
- package/src/shadcnui/ui/select.tsx +41 -65
- package/src/shadcnui/ui/separator.tsx +7 -11
- package/src/shadcnui/ui/sheet.tsx +30 -55
- package/src/shadcnui/ui/sidebar.tsx +141 -189
- package/src/shadcnui/ui/skeleton.tsx +3 -9
- package/src/shadcnui/ui/slider.tsx +11 -23
- package/src/shadcnui/ui/switch.tsx +8 -8
- package/src/shadcnui/ui/tabs.tsx +14 -21
- package/src/shadcnui/ui/textarea.tsx +5 -5
- package/src/shadcnui/ui/toggle.tsx +8 -14
- package/src/shadcnui/ui/tooltip.tsx +11 -23
- package/src/testing/providers/MockJsonApiProvider.tsx +1 -5
- package/src/testing/utils/renderWithProviders.tsx +6 -10
- package/dist/BlockNoteEditor-SZWO3MDO.mjs.map +0 -1
- package/dist/chunk-53IPQJVH.js.map +0 -1
- package/dist/chunk-E6PQQTWF.js.map +0 -1
- package/dist/chunk-I7DFEJFF.mjs.map +0 -1
- package/dist/chunk-P7R2DPD6.mjs.map +0 -1
|
@@ -7,31 +7,32 @@ import { cn } from "../../utils";
|
|
|
7
7
|
|
|
8
8
|
export interface PasswordInputProps extends React.InputHTMLAttributes<HTMLInputElement> {}
|
|
9
9
|
|
|
10
|
-
const PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(
|
|
11
|
+
({ className, type: _type, ...props }, ref) => {
|
|
12
|
+
const [showPassword, setShowPassword] = React.useState(false);
|
|
13
|
+
const disabled = props.value === "" || props.value === undefined || props.disabled;
|
|
14
|
+
const t = useTranslations();
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
return (
|
|
17
|
+
<div className="relative">
|
|
18
|
+
<Input type={showPassword ? "text" : "password"} className={cn("", className)} ref={ref} {...props} />
|
|
19
|
+
<Button
|
|
20
|
+
type="button"
|
|
21
|
+
variant="ghost"
|
|
22
|
+
size="sm"
|
|
23
|
+
className="absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent"
|
|
24
|
+
onClick={() => setShowPassword((prev) => !prev)}
|
|
25
|
+
disabled={disabled}
|
|
26
|
+
>
|
|
27
|
+
{showPassword && !disabled ? (
|
|
28
|
+
<EyeIcon className="h-4 w-4" aria-hidden="true" />
|
|
29
|
+
) : (
|
|
30
|
+
<EyeOffIcon className="h-4 w-4" aria-hidden="true" />
|
|
31
|
+
)}
|
|
32
|
+
<span className="sr-only">{showPassword ? t(`common.hide_password`) : t(`common.show_password`)}</span>
|
|
33
|
+
</Button>
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
<style>{`
|
|
35
36
|
.hide-password-toggle::-ms-reveal,
|
|
36
37
|
.hide-password-toggle::-ms-clear {
|
|
37
38
|
visibility: hidden;
|
|
@@ -39,9 +40,10 @@ const PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(({
|
|
|
39
40
|
display: none;
|
|
40
41
|
}
|
|
41
42
|
`}</style>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
);
|
|
45
47
|
PasswordInput.displayName = "PasswordInput";
|
|
46
48
|
|
|
47
49
|
export { PasswordInput };
|
|
@@ -36,7 +36,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
36
36
|
render(
|
|
37
37
|
<FormWrapper defaultValues={{ active: false }}>
|
|
38
38
|
{(form) => <FormCheckbox form={form} id="active" name="Active" />}
|
|
39
|
-
</FormWrapper
|
|
39
|
+
</FormWrapper>,
|
|
40
40
|
);
|
|
41
41
|
|
|
42
42
|
expect(screen.getByText("Active")).toBeInTheDocument();
|
|
@@ -47,7 +47,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
47
47
|
render(
|
|
48
48
|
<FormWrapper defaultValues={{ active: false }}>
|
|
49
49
|
{(form) => <FormCheckbox form={form} id="active" name="Active" isRequired={true} />}
|
|
50
|
-
</FormWrapper
|
|
50
|
+
</FormWrapper>,
|
|
51
51
|
);
|
|
52
52
|
|
|
53
53
|
expect(screen.getByText("*")).toBeInTheDocument();
|
|
@@ -57,7 +57,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
57
57
|
render(
|
|
58
58
|
<FormWrapper defaultValues={{ active: true }}>
|
|
59
59
|
{(form) => <FormCheckbox form={form} id="active" name="Active" />}
|
|
60
|
-
</FormWrapper
|
|
60
|
+
</FormWrapper>,
|
|
61
61
|
);
|
|
62
62
|
|
|
63
63
|
const checkbox = screen.getByRole("checkbox");
|
|
@@ -68,7 +68,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
68
68
|
render(
|
|
69
69
|
<FormWrapper defaultValues={{ active: false }}>
|
|
70
70
|
{(form) => <FormCheckbox form={form} id="active" name="Active" />}
|
|
71
|
-
</FormWrapper
|
|
71
|
+
</FormWrapper>,
|
|
72
72
|
);
|
|
73
73
|
|
|
74
74
|
const checkbox = screen.getByRole("checkbox");
|
|
@@ -81,7 +81,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
81
81
|
render(
|
|
82
82
|
<FormWrapper defaultValues={{ active: false }}>
|
|
83
83
|
{(form) => <FormCheckbox form={form} id="active" name="Active" />}
|
|
84
|
-
</FormWrapper
|
|
84
|
+
</FormWrapper>,
|
|
85
85
|
);
|
|
86
86
|
|
|
87
87
|
const container = screen.getByRole("checkbox").parentElement;
|
|
@@ -96,7 +96,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
96
96
|
render(
|
|
97
97
|
<FormWrapper defaultValues={{ active: false }}>
|
|
98
98
|
{(form) => <FormCheckbox form={form} id="active" name="Active" labelBefore={true} />}
|
|
99
|
-
</FormWrapper
|
|
99
|
+
</FormWrapper>,
|
|
100
100
|
);
|
|
101
101
|
|
|
102
102
|
const container = screen.getByRole("checkbox").parentElement;
|
|
@@ -111,7 +111,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
111
111
|
render(
|
|
112
112
|
<FormWrapper defaultValues={{ active: false }}>
|
|
113
113
|
{(form) => <FormCheckbox form={form} id="active" name="Active" />}
|
|
114
|
-
</FormWrapper
|
|
114
|
+
</FormWrapper>,
|
|
115
115
|
);
|
|
116
116
|
|
|
117
117
|
const label = screen.getByText("Active");
|
|
@@ -122,7 +122,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
122
122
|
render(
|
|
123
123
|
<FormWrapper defaultValues={{ active: false }}>
|
|
124
124
|
{(form) => <FormCheckbox form={form} id="active" name="Active" labelBefore={true} />}
|
|
125
|
-
</FormWrapper
|
|
125
|
+
</FormWrapper>,
|
|
126
126
|
);
|
|
127
127
|
|
|
128
128
|
const label = screen.getByText("Active");
|
|
@@ -137,7 +137,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
137
137
|
render(
|
|
138
138
|
<FormWrapper defaultValues={{ active: false }}>
|
|
139
139
|
{(form) => <FormCheckbox form={form} id="active" name="Active" />}
|
|
140
|
-
</FormWrapper
|
|
140
|
+
</FormWrapper>,
|
|
141
141
|
);
|
|
142
142
|
|
|
143
143
|
const checkbox = screen.getByRole("checkbox");
|
|
@@ -154,7 +154,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
154
154
|
render(
|
|
155
155
|
<FormWrapper defaultValues={{ active: true }}>
|
|
156
156
|
{(form) => <FormCheckbox form={form} id="active" name="Active" />}
|
|
157
|
-
</FormWrapper
|
|
157
|
+
</FormWrapper>,
|
|
158
158
|
);
|
|
159
159
|
|
|
160
160
|
const checkbox = screen.getByRole("checkbox");
|
|
@@ -171,7 +171,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
171
171
|
render(
|
|
172
172
|
<FormWrapper defaultValues={{ active: false }}>
|
|
173
173
|
{(form) => <FormCheckbox form={form} id="active" name="Active" />}
|
|
174
|
-
</FormWrapper
|
|
174
|
+
</FormWrapper>,
|
|
175
175
|
);
|
|
176
176
|
|
|
177
177
|
const label = screen.getByText("Active");
|
|
@@ -190,7 +190,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
190
190
|
render(
|
|
191
191
|
<FormWrapper defaultValues={{ active: false }}>
|
|
192
192
|
{(form) => <FormCheckbox form={form} id="active" name="Active" isRequired={true} />}
|
|
193
|
-
</FormWrapper
|
|
193
|
+
</FormWrapper>,
|
|
194
194
|
);
|
|
195
195
|
|
|
196
196
|
const label = screen.getByText("Active");
|
|
@@ -206,10 +206,8 @@ describe.skip("FormCheckbox", () => {
|
|
|
206
206
|
it("should render required indicator after label when labelBefore is true", () => {
|
|
207
207
|
render(
|
|
208
208
|
<FormWrapper defaultValues={{ active: false }}>
|
|
209
|
-
{(form) =>
|
|
210
|
-
|
|
211
|
-
)}
|
|
212
|
-
</FormWrapper>
|
|
209
|
+
{(form) => <FormCheckbox form={form} id="active" name="Active" isRequired={true} labelBefore={true} />}
|
|
210
|
+
</FormWrapper>,
|
|
213
211
|
);
|
|
214
212
|
|
|
215
213
|
expect(screen.getByText("*")).toBeInTheDocument();
|
|
@@ -221,7 +219,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
221
219
|
render(
|
|
222
220
|
<FormWrapper defaultValues={{ active: false }}>
|
|
223
221
|
{(form) => <FormCheckbox form={form} id="active" name="Active" />}
|
|
224
|
-
</FormWrapper
|
|
222
|
+
</FormWrapper>,
|
|
225
223
|
);
|
|
226
224
|
|
|
227
225
|
const label = screen.getByText("Active");
|
|
@@ -232,7 +230,7 @@ describe.skip("FormCheckbox", () => {
|
|
|
232
230
|
render(
|
|
233
231
|
<FormWrapper defaultValues={{ active: false }}>
|
|
234
232
|
{(form) => <FormCheckbox form={form} id="active" name="Active" />}
|
|
235
|
-
</FormWrapper
|
|
233
|
+
</FormWrapper>,
|
|
236
234
|
);
|
|
237
235
|
|
|
238
236
|
const checkbox = screen.getByRole("checkbox");
|
|
@@ -35,9 +35,7 @@ describe.skip("FormDate", () => {
|
|
|
35
35
|
describe("rendering", () => {
|
|
36
36
|
it("should render date input without label", () => {
|
|
37
37
|
render(
|
|
38
|
-
<FormWrapper defaultValues={{ date: undefined }}>
|
|
39
|
-
{(form) => <FormDate form={form} id="date" />}
|
|
40
|
-
</FormWrapper>
|
|
38
|
+
<FormWrapper defaultValues={{ date: undefined }}>{(form) => <FormDate form={form} id="date" />}</FormWrapper>,
|
|
41
39
|
);
|
|
42
40
|
|
|
43
41
|
expect(screen.getByRole("textbox")).toBeInTheDocument();
|
|
@@ -47,7 +45,7 @@ describe.skip("FormDate", () => {
|
|
|
47
45
|
render(
|
|
48
46
|
<FormWrapper defaultValues={{ date: undefined }}>
|
|
49
47
|
{(form) => <FormDate form={form} id="date" name="Date" />}
|
|
50
|
-
</FormWrapper
|
|
48
|
+
</FormWrapper>,
|
|
51
49
|
);
|
|
52
50
|
|
|
53
51
|
expect(screen.getByText("Date")).toBeInTheDocument();
|
|
@@ -58,7 +56,7 @@ describe.skip("FormDate", () => {
|
|
|
58
56
|
render(
|
|
59
57
|
<FormWrapper defaultValues={{ date: undefined }}>
|
|
60
58
|
{(form) => <FormDate form={form} id="date" name="Date" isRequired={true} />}
|
|
61
|
-
</FormWrapper
|
|
59
|
+
</FormWrapper>,
|
|
62
60
|
);
|
|
63
61
|
|
|
64
62
|
expect(screen.getByText("*")).toBeInTheDocument();
|
|
@@ -66,9 +64,7 @@ describe.skip("FormDate", () => {
|
|
|
66
64
|
|
|
67
65
|
it("should render calendar icon button", () => {
|
|
68
66
|
render(
|
|
69
|
-
<FormWrapper defaultValues={{ date: undefined }}>
|
|
70
|
-
{(form) => <FormDate form={form} id="date" />}
|
|
71
|
-
</FormWrapper>
|
|
67
|
+
<FormWrapper defaultValues={{ date: undefined }}>{(form) => <FormDate form={form} id="date" />}</FormWrapper>,
|
|
72
68
|
);
|
|
73
69
|
|
|
74
70
|
// Look for the calendar icon button
|
|
@@ -80,9 +76,7 @@ describe.skip("FormDate", () => {
|
|
|
80
76
|
const testDate = new Date(2024, 0, 15); // January 15, 2024
|
|
81
77
|
|
|
82
78
|
render(
|
|
83
|
-
<FormWrapper defaultValues={{ date: testDate }}>
|
|
84
|
-
{(form) => <FormDate form={form} id="date" />}
|
|
85
|
-
</FormWrapper>
|
|
79
|
+
<FormWrapper defaultValues={{ date: testDate }}>{(form) => <FormDate form={form} id="date" />}</FormWrapper>,
|
|
86
80
|
);
|
|
87
81
|
|
|
88
82
|
const input = screen.getByRole("textbox");
|
|
@@ -92,9 +86,7 @@ describe.skip("FormDate", () => {
|
|
|
92
86
|
|
|
93
87
|
it("should show placeholder based on locale format", () => {
|
|
94
88
|
render(
|
|
95
|
-
<FormWrapper defaultValues={{ date: undefined }}>
|
|
96
|
-
{(form) => <FormDate form={form} id="date" />}
|
|
97
|
-
</FormWrapper>
|
|
89
|
+
<FormWrapper defaultValues={{ date: undefined }}>{(form) => <FormDate form={form} id="date" />}</FormWrapper>,
|
|
98
90
|
);
|
|
99
91
|
|
|
100
92
|
const input = screen.getByRole("textbox");
|
|
@@ -108,9 +100,7 @@ describe.skip("FormDate", () => {
|
|
|
108
100
|
const testDate = new Date(2024, 0, 15);
|
|
109
101
|
|
|
110
102
|
render(
|
|
111
|
-
<FormWrapper defaultValues={{ date: testDate }}>
|
|
112
|
-
{(form) => <FormDate form={form} id="date" />}
|
|
113
|
-
</FormWrapper>
|
|
103
|
+
<FormWrapper defaultValues={{ date: testDate }}>{(form) => <FormDate form={form} id="date" />}</FormWrapper>,
|
|
114
104
|
);
|
|
115
105
|
|
|
116
106
|
// Should have at least 2 buttons (calendar + clear)
|
|
@@ -120,9 +110,7 @@ describe.skip("FormDate", () => {
|
|
|
120
110
|
|
|
121
111
|
it("should not show clear button when value is empty", () => {
|
|
122
112
|
render(
|
|
123
|
-
<FormWrapper defaultValues={{ date: undefined }}>
|
|
124
|
-
{(form) => <FormDate form={form} id="date" />}
|
|
125
|
-
</FormWrapper>
|
|
113
|
+
<FormWrapper defaultValues={{ date: undefined }}>{(form) => <FormDate form={form} id="date" />}</FormWrapper>,
|
|
126
114
|
);
|
|
127
115
|
|
|
128
116
|
// Should only have calendar button
|
|
@@ -134,9 +122,7 @@ describe.skip("FormDate", () => {
|
|
|
134
122
|
describe("text input", () => {
|
|
135
123
|
it("should accept text input", () => {
|
|
136
124
|
render(
|
|
137
|
-
<FormWrapper defaultValues={{ date: undefined }}>
|
|
138
|
-
{(form) => <FormDate form={form} id="date" />}
|
|
139
|
-
</FormWrapper>
|
|
125
|
+
<FormWrapper defaultValues={{ date: undefined }}>{(form) => <FormDate form={form} id="date" />}</FormWrapper>,
|
|
140
126
|
);
|
|
141
127
|
|
|
142
128
|
const input = screen.getByRole("textbox");
|
|
@@ -149,9 +135,7 @@ describe.skip("FormDate", () => {
|
|
|
149
135
|
const testDate = new Date(2024, 0, 15);
|
|
150
136
|
|
|
151
137
|
render(
|
|
152
|
-
<FormWrapper defaultValues={{ date: testDate }}>
|
|
153
|
-
{(form) => <FormDate form={form} id="date" />}
|
|
154
|
-
</FormWrapper>
|
|
138
|
+
<FormWrapper defaultValues={{ date: testDate }}>{(form) => <FormDate form={form} id="date" />}</FormWrapper>,
|
|
155
139
|
);
|
|
156
140
|
|
|
157
141
|
const input = screen.getByRole("textbox");
|
|
@@ -168,7 +152,7 @@ describe.skip("FormDate", () => {
|
|
|
168
152
|
render(
|
|
169
153
|
<FormWrapper defaultValues={{ date: undefined }}>
|
|
170
154
|
{(form) => <FormDate form={form} id="date" minDate={minDate} />}
|
|
171
|
-
</FormWrapper
|
|
155
|
+
</FormWrapper>,
|
|
172
156
|
);
|
|
173
157
|
|
|
174
158
|
// Component should render without errors
|
|
@@ -183,7 +167,7 @@ describe.skip("FormDate", () => {
|
|
|
183
167
|
render(
|
|
184
168
|
<FormWrapper defaultValues={{ birthDate: testDate }}>
|
|
185
169
|
{(form) => <FormDate form={form} id="birthDate" name="Birth Date" />}
|
|
186
|
-
</FormWrapper
|
|
170
|
+
</FormWrapper>,
|
|
187
171
|
);
|
|
188
172
|
|
|
189
173
|
const input = screen.getByRole("textbox");
|
|
@@ -196,7 +180,7 @@ describe.skip("FormDate", () => {
|
|
|
196
180
|
render(
|
|
197
181
|
<FormWrapper defaultValues={{ date: undefined }}>
|
|
198
182
|
{(form) => <FormDate form={form} id="date" name="Date" />}
|
|
199
|
-
</FormWrapper
|
|
183
|
+
</FormWrapper>,
|
|
200
184
|
);
|
|
201
185
|
|
|
202
186
|
const input = screen.getByRole("textbox");
|
|
@@ -207,7 +191,7 @@ describe.skip("FormDate", () => {
|
|
|
207
191
|
render(
|
|
208
192
|
<FormWrapper defaultValues={{ date: undefined }}>
|
|
209
193
|
{(form) => <FormDate form={form} id="date" name="Appointment Date" />}
|
|
210
|
-
</FormWrapper
|
|
194
|
+
</FormWrapper>,
|
|
211
195
|
);
|
|
212
196
|
|
|
213
197
|
expect(screen.getByText("Appointment Date")).toBeInTheDocument();
|
|
@@ -28,11 +28,7 @@ describe("FormInput", () => {
|
|
|
28
28
|
|
|
29
29
|
describe("rendering", () => {
|
|
30
30
|
it("should render input without label", () => {
|
|
31
|
-
render(
|
|
32
|
-
<FormWrapper defaultValues={{ title: "" }}>
|
|
33
|
-
{(form) => <FormInput form={form} id="title" />}
|
|
34
|
-
</FormWrapper>
|
|
35
|
-
);
|
|
31
|
+
render(<FormWrapper defaultValues={{ title: "" }}>{(form) => <FormInput form={form} id="title" />}</FormWrapper>);
|
|
36
32
|
|
|
37
33
|
expect(screen.getByRole("textbox")).toBeInTheDocument();
|
|
38
34
|
});
|
|
@@ -41,7 +37,7 @@ describe("FormInput", () => {
|
|
|
41
37
|
render(
|
|
42
38
|
<FormWrapper defaultValues={{ title: "" }}>
|
|
43
39
|
{(form) => <FormInput form={form} id="title" name="Title" />}
|
|
44
|
-
</FormWrapper
|
|
40
|
+
</FormWrapper>,
|
|
45
41
|
);
|
|
46
42
|
|
|
47
43
|
expect(screen.getByText("Title")).toBeInTheDocument();
|
|
@@ -52,7 +48,7 @@ describe("FormInput", () => {
|
|
|
52
48
|
render(
|
|
53
49
|
<FormWrapper defaultValues={{ title: "" }}>
|
|
54
50
|
{(form) => <FormInput form={form} id="title" name="Title" isRequired={true} />}
|
|
55
|
-
</FormWrapper
|
|
51
|
+
</FormWrapper>,
|
|
56
52
|
);
|
|
57
53
|
|
|
58
54
|
expect(screen.getByText("*")).toBeInTheDocument();
|
|
@@ -62,7 +58,7 @@ describe("FormInput", () => {
|
|
|
62
58
|
render(
|
|
63
59
|
<FormWrapper defaultValues={{ title: "" }}>
|
|
64
60
|
{(form) => <FormInput form={form} id="title" placeholder="Enter title" />}
|
|
65
|
-
</FormWrapper
|
|
61
|
+
</FormWrapper>,
|
|
66
62
|
);
|
|
67
63
|
|
|
68
64
|
expect(screen.getByPlaceholderText("Enter title")).toBeInTheDocument();
|
|
@@ -72,7 +68,7 @@ describe("FormInput", () => {
|
|
|
72
68
|
render(
|
|
73
69
|
<FormWrapper defaultValues={{ title: "" }}>
|
|
74
70
|
{(form) => <FormInput form={form} id="title" testId="title-input" />}
|
|
75
|
-
</FormWrapper
|
|
71
|
+
</FormWrapper>,
|
|
76
72
|
);
|
|
77
73
|
|
|
78
74
|
expect(screen.getByTestId("title-input")).toBeInTheDocument();
|
|
@@ -81,11 +77,7 @@ describe("FormInput", () => {
|
|
|
81
77
|
|
|
82
78
|
describe("input types", () => {
|
|
83
79
|
it("should render text input by default", () => {
|
|
84
|
-
render(
|
|
85
|
-
<FormWrapper defaultValues={{ title: "" }}>
|
|
86
|
-
{(form) => <FormInput form={form} id="title" />}
|
|
87
|
-
</FormWrapper>
|
|
88
|
-
);
|
|
80
|
+
render(<FormWrapper defaultValues={{ title: "" }}>{(form) => <FormInput form={form} id="title" />}</FormWrapper>);
|
|
89
81
|
|
|
90
82
|
const input = screen.getByRole("textbox");
|
|
91
83
|
expect(input).toHaveAttribute("type", "text");
|
|
@@ -95,7 +87,7 @@ describe("FormInput", () => {
|
|
|
95
87
|
render(
|
|
96
88
|
<FormWrapper defaultValues={{ count: 0 }}>
|
|
97
89
|
{(form) => <FormInput form={form} id="count" type="number" />}
|
|
98
|
-
</FormWrapper
|
|
90
|
+
</FormWrapper>,
|
|
99
91
|
);
|
|
100
92
|
|
|
101
93
|
const input = screen.getByRole("spinbutton");
|
|
@@ -106,7 +98,7 @@ describe("FormInput", () => {
|
|
|
106
98
|
render(
|
|
107
99
|
<FormWrapper defaultValues={{ price: 0 }}>
|
|
108
100
|
{(form) => <FormInput form={form} id="price" type="currency" />}
|
|
109
|
-
</FormWrapper
|
|
101
|
+
</FormWrapper>,
|
|
110
102
|
);
|
|
111
103
|
|
|
112
104
|
expect(screen.getByText("€")).toBeInTheDocument();
|
|
@@ -118,7 +110,7 @@ describe("FormInput", () => {
|
|
|
118
110
|
render(
|
|
119
111
|
<FormWrapper defaultValues={{ password: "" }}>
|
|
120
112
|
{(form) => <FormInput form={form} id="password" type="password" />}
|
|
121
|
-
</FormWrapper
|
|
113
|
+
</FormWrapper>,
|
|
122
114
|
);
|
|
123
115
|
|
|
124
116
|
const input = document.querySelector('input[type="password"]');
|
|
@@ -129,7 +121,7 @@ describe("FormInput", () => {
|
|
|
129
121
|
render(
|
|
130
122
|
<FormWrapper defaultValues={{ url: "" }}>
|
|
131
123
|
{(form) => <FormInput form={form} id="url" type="link" />}
|
|
132
|
-
</FormWrapper
|
|
124
|
+
</FormWrapper>,
|
|
133
125
|
);
|
|
134
126
|
|
|
135
127
|
const input = screen.getByRole("textbox");
|
|
@@ -139,11 +131,7 @@ describe("FormInput", () => {
|
|
|
139
131
|
|
|
140
132
|
describe("user interaction", () => {
|
|
141
133
|
it("should update value on change for text input", () => {
|
|
142
|
-
render(
|
|
143
|
-
<FormWrapper defaultValues={{ title: "" }}>
|
|
144
|
-
{(form) => <FormInput form={form} id="title" />}
|
|
145
|
-
</FormWrapper>
|
|
146
|
-
);
|
|
134
|
+
render(<FormWrapper defaultValues={{ title: "" }}>{(form) => <FormInput form={form} id="title" />}</FormWrapper>);
|
|
147
135
|
|
|
148
136
|
const input = screen.getByRole("textbox");
|
|
149
137
|
fireEvent.change(input, { target: { value: "New Title" } });
|
|
@@ -155,7 +143,7 @@ describe("FormInput", () => {
|
|
|
155
143
|
render(
|
|
156
144
|
<FormWrapper defaultValues={{ count: 0 }}>
|
|
157
145
|
{(form) => <FormInput form={form} id="count" type="number" />}
|
|
158
|
-
</FormWrapper
|
|
146
|
+
</FormWrapper>,
|
|
159
147
|
);
|
|
160
148
|
|
|
161
149
|
const input = screen.getByRole("spinbutton");
|
|
@@ -170,7 +158,7 @@ describe("FormInput", () => {
|
|
|
170
158
|
render(
|
|
171
159
|
<FormWrapper defaultValues={{ title: "" }}>
|
|
172
160
|
{(form) => <FormInput form={form} id="title" onChange={onChange} />}
|
|
173
|
-
</FormWrapper
|
|
161
|
+
</FormWrapper>,
|
|
174
162
|
);
|
|
175
163
|
|
|
176
164
|
const input = screen.getByRole("textbox");
|
|
@@ -184,7 +172,7 @@ describe("FormInput", () => {
|
|
|
184
172
|
render(
|
|
185
173
|
<FormWrapper defaultValues={{ title: "" }}>
|
|
186
174
|
{(form) => <FormInput form={form} id="title" onBlur={onBlur} />}
|
|
187
|
-
</FormWrapper
|
|
175
|
+
</FormWrapper>,
|
|
188
176
|
);
|
|
189
177
|
|
|
190
178
|
const input = screen.getByRole("textbox");
|
|
@@ -201,7 +189,7 @@ describe("FormInput", () => {
|
|
|
201
189
|
render(
|
|
202
190
|
<FormWrapper defaultValues={{ title: "" }}>
|
|
203
191
|
{(form) => <FormInput form={form} id="title" onKeyDown={onKeyDown} />}
|
|
204
|
-
</FormWrapper
|
|
192
|
+
</FormWrapper>,
|
|
205
193
|
);
|
|
206
194
|
|
|
207
195
|
const input = screen.getByRole("textbox");
|
|
@@ -216,7 +204,7 @@ describe("FormInput", () => {
|
|
|
216
204
|
render(
|
|
217
205
|
<FormWrapper defaultValues={{ title: "" }}>
|
|
218
206
|
{(form) => <FormInput form={form} id="title" disabled={true} />}
|
|
219
|
-
</FormWrapper
|
|
207
|
+
</FormWrapper>,
|
|
220
208
|
);
|
|
221
209
|
|
|
222
210
|
const input = screen.getByRole("textbox");
|
|
@@ -224,11 +212,7 @@ describe("FormInput", () => {
|
|
|
224
212
|
});
|
|
225
213
|
|
|
226
214
|
it("should not be disabled by default", () => {
|
|
227
|
-
render(
|
|
228
|
-
<FormWrapper defaultValues={{ title: "" }}>
|
|
229
|
-
{(form) => <FormInput form={form} id="title" />}
|
|
230
|
-
</FormWrapper>
|
|
231
|
-
);
|
|
215
|
+
render(<FormWrapper defaultValues={{ title: "" }}>{(form) => <FormInput form={form} id="title" />}</FormWrapper>);
|
|
232
216
|
|
|
233
217
|
const input = screen.getByRole("textbox");
|
|
234
218
|
expect(input).not.toBeDisabled();
|
|
@@ -240,7 +224,7 @@ describe("FormInput", () => {
|
|
|
240
224
|
render(
|
|
241
225
|
<FormWrapper defaultValues={{ url: "" }}>
|
|
242
226
|
{(form) => <FormInput form={form} id="url" type="link" />}
|
|
243
|
-
</FormWrapper
|
|
227
|
+
</FormWrapper>,
|
|
244
228
|
);
|
|
245
229
|
|
|
246
230
|
const input = screen.getByRole("textbox");
|
|
@@ -254,7 +238,7 @@ describe("FormInput", () => {
|
|
|
254
238
|
render(
|
|
255
239
|
<FormWrapper defaultValues={{ url: "" }}>
|
|
256
240
|
{(form) => <FormInput form={form} id="url" type="link" />}
|
|
257
|
-
</FormWrapper
|
|
241
|
+
</FormWrapper>,
|
|
258
242
|
);
|
|
259
243
|
|
|
260
244
|
const input = screen.getByRole("textbox");
|
|
@@ -268,7 +252,7 @@ describe("FormInput", () => {
|
|
|
268
252
|
render(
|
|
269
253
|
<FormWrapper defaultValues={{ url: "" }}>
|
|
270
254
|
{(form) => <FormInput form={form} id="url" type="link" />}
|
|
271
|
-
</FormWrapper
|
|
255
|
+
</FormWrapper>,
|
|
272
256
|
);
|
|
273
257
|
|
|
274
258
|
const input = screen.getByRole("textbox");
|
|
@@ -284,7 +268,7 @@ describe("FormInput", () => {
|
|
|
284
268
|
render(
|
|
285
269
|
<FormWrapper defaultValues={{ title: "" }}>
|
|
286
270
|
{(form) => <FormInput form={form} id="title" autoFocus={true} />}
|
|
287
|
-
</FormWrapper
|
|
271
|
+
</FormWrapper>,
|
|
288
272
|
);
|
|
289
273
|
|
|
290
274
|
const input = screen.getByRole("textbox");
|
|
@@ -36,7 +36,7 @@ describe.skip("FormSelect", () => {
|
|
|
36
36
|
render(
|
|
37
37
|
<FormWrapper defaultValues={{ status: "" }}>
|
|
38
38
|
{(form) => <FormSelect form={form} id="status" values={mockValues} />}
|
|
39
|
-
</FormWrapper
|
|
39
|
+
</FormWrapper>,
|
|
40
40
|
);
|
|
41
41
|
|
|
42
42
|
expect(screen.getByRole("combobox")).toBeInTheDocument();
|
|
@@ -46,7 +46,7 @@ describe.skip("FormSelect", () => {
|
|
|
46
46
|
render(
|
|
47
47
|
<FormWrapper defaultValues={{ status: "" }}>
|
|
48
48
|
{(form) => <FormSelect form={form} id="status" name="Status" values={mockValues} />}
|
|
49
|
-
</FormWrapper
|
|
49
|
+
</FormWrapper>,
|
|
50
50
|
);
|
|
51
51
|
|
|
52
52
|
expect(screen.getByText("Status")).toBeInTheDocument();
|
|
@@ -56,10 +56,8 @@ describe.skip("FormSelect", () => {
|
|
|
56
56
|
it("should render placeholder", () => {
|
|
57
57
|
render(
|
|
58
58
|
<FormWrapper defaultValues={{ status: "" }}>
|
|
59
|
-
{(form) =>
|
|
60
|
-
|
|
61
|
-
)}
|
|
62
|
-
</FormWrapper>
|
|
59
|
+
{(form) => <FormSelect form={form} id="status" values={mockValues} placeholder="Select an option" />}
|
|
60
|
+
</FormWrapper>,
|
|
63
61
|
);
|
|
64
62
|
|
|
65
63
|
expect(screen.getByText("Select an option")).toBeInTheDocument();
|
|
@@ -69,7 +67,7 @@ describe.skip("FormSelect", () => {
|
|
|
69
67
|
render(
|
|
70
68
|
<FormWrapper defaultValues={{ status: "option2" }}>
|
|
71
69
|
{(form) => <FormSelect form={form} id="status" values={mockValues} />}
|
|
72
|
-
</FormWrapper
|
|
70
|
+
</FormWrapper>,
|
|
73
71
|
);
|
|
74
72
|
|
|
75
73
|
expect(screen.getByRole("combobox")).toHaveTextContent("Option 2");
|
|
@@ -81,10 +79,8 @@ describe.skip("FormSelect", () => {
|
|
|
81
79
|
// Just verify it renders without error with useRows
|
|
82
80
|
render(
|
|
83
81
|
<FormWrapper defaultValues={{ status: "" }}>
|
|
84
|
-
{(form) =>
|
|
85
|
-
|
|
86
|
-
)}
|
|
87
|
-
</FormWrapper>
|
|
82
|
+
{(form) => <FormSelect form={form} id="status" name="Status" values={mockValues} useRows={true} />}
|
|
83
|
+
</FormWrapper>,
|
|
88
84
|
);
|
|
89
85
|
|
|
90
86
|
expect(screen.getByRole("combobox")).toBeInTheDocument();
|
|
@@ -94,10 +90,8 @@ describe.skip("FormSelect", () => {
|
|
|
94
90
|
it("should render label with row layout styling when useRows is true", () => {
|
|
95
91
|
const { container } = render(
|
|
96
92
|
<FormWrapper defaultValues={{ status: "" }}>
|
|
97
|
-
{(form) =>
|
|
98
|
-
|
|
99
|
-
)}
|
|
100
|
-
</FormWrapper>
|
|
93
|
+
{(form) => <FormSelect form={form} id="status" name="Status" values={mockValues} useRows={true} />}
|
|
94
|
+
</FormWrapper>,
|
|
101
95
|
);
|
|
102
96
|
|
|
103
97
|
// The label should have min-w-28 class when useRows is true
|
|
@@ -111,7 +105,7 @@ describe.skip("FormSelect", () => {
|
|
|
111
105
|
render(
|
|
112
106
|
<FormWrapper defaultValues={{ status: "" }}>
|
|
113
107
|
{(form) => <FormSelect form={form} id="status" values={mockValues} />}
|
|
114
|
-
</FormWrapper
|
|
108
|
+
</FormWrapper>,
|
|
115
109
|
);
|
|
116
110
|
|
|
117
111
|
const trigger = screen.getByRole("combobox");
|
|
@@ -124,7 +118,7 @@ describe.skip("FormSelect", () => {
|
|
|
124
118
|
render(
|
|
125
119
|
<FormWrapper defaultValues={{ status: "" }}>
|
|
126
120
|
{(form) => <FormSelect form={form} id="status" values={[]} placeholder="Select" />}
|
|
127
|
-
</FormWrapper
|
|
121
|
+
</FormWrapper>,
|
|
128
122
|
);
|
|
129
123
|
|
|
130
124
|
expect(screen.getByRole("combobox")).toBeInTheDocument();
|
|
@@ -134,7 +128,7 @@ describe.skip("FormSelect", () => {
|
|
|
134
128
|
render(
|
|
135
129
|
<FormWrapper defaultValues={{ status: "" }}>
|
|
136
130
|
{(form) => <FormSelect form={form} id="status" values={mockValues} />}
|
|
137
|
-
</FormWrapper
|
|
131
|
+
</FormWrapper>,
|
|
138
132
|
);
|
|
139
133
|
|
|
140
134
|
const combobox = screen.getByRole("combobox");
|
|
@@ -145,7 +139,7 @@ describe.skip("FormSelect", () => {
|
|
|
145
139
|
render(
|
|
146
140
|
<FormWrapper defaultValues={{ status: "option1" }}>
|
|
147
141
|
{(form) => <FormSelect form={form} id="status" values={mockValues} />}
|
|
148
|
-
</FormWrapper
|
|
142
|
+
</FormWrapper>,
|
|
149
143
|
);
|
|
150
144
|
|
|
151
145
|
expect(screen.getByRole("combobox")).toHaveTextContent("Option 1");
|
|
@@ -155,7 +149,7 @@ describe.skip("FormSelect", () => {
|
|
|
155
149
|
render(
|
|
156
150
|
<FormWrapper defaultValues={{ status: "option3" }}>
|
|
157
151
|
{(form) => <FormSelect form={form} id="status" values={mockValues} />}
|
|
158
|
-
</FormWrapper
|
|
152
|
+
</FormWrapper>,
|
|
159
153
|
);
|
|
160
154
|
|
|
161
155
|
expect(screen.getByRole("combobox")).toHaveTextContent("Option 3");
|
|
@@ -167,7 +161,7 @@ describe.skip("FormSelect", () => {
|
|
|
167
161
|
render(
|
|
168
162
|
<FormWrapper defaultValues={{ status: "" }}>
|
|
169
163
|
{(form) => <FormSelect form={form} id="status" values={mockValues} />}
|
|
170
|
-
</FormWrapper
|
|
164
|
+
</FormWrapper>,
|
|
171
165
|
);
|
|
172
166
|
|
|
173
167
|
const combobox = screen.getByRole("combobox");
|
|
@@ -33,7 +33,7 @@ type ContentListTableProps = {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
export const ContentListTable = memo(function ContentListTable(props: ContentListTableProps) {
|
|
36
|
-
const { data, fields, checkedIds, toggleId, allowSearch, filters } = props;
|
|
36
|
+
const { data, fields, checkedIds, toggleId, allowSearch, filters: _filters } = props;
|
|
37
37
|
|
|
38
38
|
const { data: tableData, columns: tableColumns } = useTableGenerator(props.tableGeneratorType, {
|
|
39
39
|
data: data?.data ?? EMPTY_ARRAY,
|