@arquimedes.co/eureka-forms 3.0.71-test → 3.0.72-test

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.
Files changed (167) hide show
  1. package/README +33 -1
  2. package/dist/@Types/AvailabilityFormStep.d.ts +48 -0
  3. package/dist/@Types/AvailabilityFormStep.js +24 -0
  4. package/dist/@Types/BankAccountFormStep.d.ts +67 -0
  5. package/dist/@Types/BankAccountFormStep.js +14 -0
  6. package/dist/@Types/BookingFormStep.d.ts +249 -0
  7. package/dist/@Types/BookingFormStep.js +65 -0
  8. package/dist/@Types/CalendarFormStep.d.ts +209 -0
  9. package/dist/@Types/CalendarFormStep.js +55 -0
  10. package/dist/@Types/CommunicationChannelFormStep.d.ts +51 -0
  11. package/dist/@Types/CommunicationChannelFormStep.js +15 -0
  12. package/dist/@Types/ConsentFormStep.d.ts +36 -0
  13. package/dist/@Types/ConsentFormStep.js +8 -0
  14. package/dist/@Types/EntityFormFormStep.d.ts +66 -0
  15. package/dist/@Types/EntityFormFormStep.js +20 -0
  16. package/dist/@Types/EventFormStep.d.ts +52 -0
  17. package/dist/@Types/EventFormStep.js +13 -0
  18. package/dist/@Types/ExternalReferenceFormStep.d.ts +74 -0
  19. package/dist/@Types/ExternalReferenceFormStep.js +20 -0
  20. package/dist/@Types/FormStep.d.ts +7 -2
  21. package/dist/@Types/FormStep.js +2 -1
  22. package/dist/@Types/LocationFormStep.d.ts +159 -0
  23. package/dist/@Types/LocationFormStep.js +46 -0
  24. package/dist/@Types/NumericFormSteps.d.ts +108 -0
  25. package/dist/@Types/NumericFormSteps.js +20 -0
  26. package/dist/@Types/PredefinedSelectorFormStep.d.ts +51 -0
  27. package/dist/@Types/PredefinedSelectorFormStep.js +39 -0
  28. package/dist/@Types/StepRef.d.ts +135 -0
  29. package/dist/@Types/StepRef.js +49 -0
  30. package/dist/App/App.stories.d.ts +10 -0
  31. package/dist/App/App.stories.js +189 -0
  32. package/dist/App/App.submitError.test.d.ts +1 -0
  33. package/dist/App/App.submitError.test.js +53 -0
  34. package/dist/App/AppHooks.js +8 -0
  35. package/dist/App/AppHooks.test.js +8 -0
  36. package/dist/BookingManage/AppointmentText.d.ts +5 -0
  37. package/dist/BookingManage/AppointmentText.js +20 -0
  38. package/dist/BookingManage/BookingManagePage.d.ts +17 -0
  39. package/dist/BookingManage/BookingManagePage.js +177 -0
  40. package/dist/BookingManage/BookingManagePage.module.css +115 -0
  41. package/dist/BookingManage/BookingManagePage.test.d.ts +1 -0
  42. package/dist/BookingManage/BookingManagePage.test.js +149 -0
  43. package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +14 -5
  44. package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +8 -1
  45. package/dist/Form/ConfirmationDialog/ConfirmationDialog.module.css +12 -0
  46. package/dist/Form/ConfirmationDialog/ConfirmationDialog.test.d.ts +1 -0
  47. package/dist/Form/ConfirmationDialog/ConfirmationDialog.test.js +21 -0
  48. package/dist/Form/Form.d.ts +3 -0
  49. package/dist/Form/Form.js +16 -8
  50. package/dist/Form/FormFunctions.d.ts +17 -0
  51. package/dist/Form/FormFunctions.js +22 -0
  52. package/dist/Form/FormFunctions.test.js +28 -1
  53. package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +1 -1
  54. package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +3 -2
  55. package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +1 -1
  56. package/dist/Form/FormTypes/StepperForm/StepperForm.js +3 -2
  57. package/dist/Form/SubmitError/SubmitError.d.ts +11 -0
  58. package/dist/Form/SubmitError/SubmitError.js +9 -0
  59. package/dist/Form/SubmitError/SubmitError.module.css +25 -0
  60. package/dist/Form/SubmitError/SubmitError.test.d.ts +1 -0
  61. package/dist/Form/SubmitError/SubmitError.test.js +34 -0
  62. package/dist/Form/SubmitError/SubmitErrorReason.d.ts +13 -0
  63. package/dist/Form/SubmitError/SubmitErrorReason.js +20 -0
  64. package/dist/FormSteps/AvailabilityStep/AvailabilityStep.d.ts +7 -0
  65. package/dist/FormSteps/AvailabilityStep/AvailabilityStep.js +14 -0
  66. package/dist/FormSteps/AvailabilityStep/MaterialAvailabilityStep/MaterialAvailabilityStep.d.ts +8 -0
  67. package/dist/FormSteps/AvailabilityStep/MaterialAvailabilityStep/MaterialAvailabilityStep.js +32 -0
  68. package/dist/FormSteps/BookingStep/BookingStep.d.ts +17 -0
  69. package/dist/FormSteps/BookingStep/BookingStep.js +14 -0
  70. package/dist/FormSteps/BookingStep/MaterialBookingStep/MaterialBookingStep.d.ts +21 -0
  71. package/dist/FormSteps/BookingStep/MaterialBookingStep/MaterialBookingStep.js +289 -0
  72. package/dist/FormSteps/BookingStep/MaterialBookingStep/MaterialBookingStep.test.d.ts +1 -0
  73. package/dist/FormSteps/BookingStep/MaterialBookingStep/MaterialBookingStep.test.js +275 -0
  74. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.mobileLabel.test.js +20 -12
  75. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +6 -13
  76. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.module.css +2 -13
  77. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.lateClassifiers.test.d.ts +1 -0
  78. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.lateClassifiers.test.js +70 -0
  79. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +3 -1
  80. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +26 -26
  81. package/dist/FormSteps/EntityValueStep/entityValueDependencyValue.d.ts +12 -0
  82. package/dist/FormSteps/EntityValueStep/entityValueDependencyValue.js +35 -0
  83. package/dist/FormSteps/EntityValueStep/entityValueDependencyValue.test.d.ts +1 -0
  84. package/dist/FormSteps/EntityValueStep/entityValueDependencyValue.test.js +31 -0
  85. package/dist/FormSteps/EntityValueStep/entityValuePickerWatchedSteps.d.ts +27 -0
  86. package/dist/FormSteps/EntityValueStep/entityValuePickerWatchedSteps.js +64 -0
  87. package/dist/FormSteps/EntityValueStep/entityValuePickerWatchedSteps.test.d.ts +1 -0
  88. package/dist/FormSteps/EntityValueStep/entityValuePickerWatchedSteps.test.js +95 -0
  89. package/dist/FormSteps/LocationStep/LocationStep.d.ts +10 -0
  90. package/dist/FormSteps/LocationStep/LocationStep.js +14 -0
  91. package/dist/FormSteps/LocationStep/MaterialLocationStep/MaterialLocationStep.d.ts +3 -0
  92. package/dist/FormSteps/LocationStep/MaterialLocationStep/MaterialLocationStep.js +54 -0
  93. package/dist/FormSteps/LocationStep/MaterialLocationStep/MaterialLocationStep.module.css +18 -0
  94. package/dist/FormSteps/NumberStep/MaterialNumberStep/MaterialNumberStep.d.ts +3 -0
  95. package/dist/FormSteps/NumberStep/MaterialNumberStep/MaterialNumberStep.js +170 -0
  96. package/dist/FormSteps/NumberStep/MaterialNumberStep/MaterialNumberStep.module.css +96 -0
  97. package/dist/FormSteps/NumberStep/NumberStep.d.ts +10 -0
  98. package/dist/FormSteps/NumberStep/NumberStep.js +14 -0
  99. package/dist/FormSteps/Step.js +16 -0
  100. package/dist/FormSteps/StepFunctions.js +14 -0
  101. package/dist/FormSteps/StepFunctions.test.js +54 -0
  102. package/dist/FormSteps/StepHooks.d.ts +21 -0
  103. package/dist/FormSteps/StepHooks.js +55 -8
  104. package/dist/FormSteps/StepHooks.test.d.ts +1 -0
  105. package/dist/FormSteps/StepHooks.test.js +92 -0
  106. package/dist/FormSteps/isStepHiddenByCondition.test.d.ts +1 -0
  107. package/dist/FormSteps/isStepHiddenByCondition.test.js +42 -0
  108. package/dist/Icons/AddIcon.d.ts +3 -0
  109. package/dist/Icons/AddIcon.js +7 -0
  110. package/dist/Icons/EditIcon.d.ts +3 -0
  111. package/dist/Icons/EditIcon.js +7 -0
  112. package/dist/Icons/RemoveIcon.d.ts +3 -0
  113. package/dist/Icons/RemoveIcon.js +7 -0
  114. package/dist/Icons/ViewDayIcon.d.ts +3 -0
  115. package/dist/Icons/ViewDayIcon.js +7 -0
  116. package/dist/Icons/ViewWeekIcon.d.ts +3 -0
  117. package/dist/Icons/ViewWeekIcon.js +7 -0
  118. package/dist/Services/BookingService.d.ts +226 -0
  119. package/dist/Services/BookingService.js +264 -0
  120. package/dist/Services/BookingService.test.d.ts +1 -0
  121. package/dist/Services/BookingService.test.js +178 -0
  122. package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.d.ts +19 -0
  123. package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.js +80 -0
  124. package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.module.css +88 -0
  125. package/dist/Shared/ErkAddressAutocomplete/googlePlaces.d.ts +29 -0
  126. package/dist/Shared/ErkAddressAutocomplete/googlePlaces.js +139 -0
  127. package/dist/Shared/ErkAvailabilityPicker/ErkAvailabilityPicker.d.ts +25 -0
  128. package/dist/Shared/ErkAvailabilityPicker/ErkAvailabilityPicker.js +112 -0
  129. package/dist/Shared/ErkAvailabilityPicker/ErkAvailabilityPicker.module.css +88 -0
  130. package/dist/Shared/ErkAvailabilityPicker/ErkAvailabilityPicker.test.d.ts +1 -0
  131. package/dist/Shared/ErkAvailabilityPicker/ErkAvailabilityPicker.test.js +73 -0
  132. package/dist/Shared/ErkBookingPicker/ErkBookingPicker.d.ts +105 -0
  133. package/dist/Shared/ErkBookingPicker/ErkBookingPicker.js +399 -0
  134. package/dist/Shared/ErkBookingPicker/ErkBookingPicker.module.css +646 -0
  135. package/dist/Shared/ErkBookingPicker/ErkBookingPicker.stories.d.ts +36 -0
  136. package/dist/Shared/ErkBookingPicker/ErkBookingPicker.stories.js +177 -0
  137. package/dist/Shared/ErkBookingPicker/ErkBookingPicker.stories.test.d.ts +1 -0
  138. package/dist/Shared/ErkBookingPicker/ErkBookingPicker.stories.test.js +47 -0
  139. package/dist/Shared/ErkBookingPicker/ErkBookingPicker.test.d.ts +1 -0
  140. package/dist/Shared/ErkBookingPicker/ErkBookingPicker.test.js +440 -0
  141. package/dist/Shared/ErkDatePicker/ErkDatePicker.js +1 -3
  142. package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.d.ts +2 -3
  143. package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.js +1 -2
  144. package/dist/Shared/ErkIconButton/ErkIconButton.d.ts +17 -0
  145. package/dist/Shared/ErkIconButton/ErkIconButton.js +11 -0
  146. package/dist/Shared/ErkIconButton/ErkIconButton.module.css +41 -0
  147. package/dist/Shared/ErkLocationField/ErkLocationField.d.ts +24 -0
  148. package/dist/Shared/ErkLocationField/ErkLocationField.js +128 -0
  149. package/dist/Shared/ErkLocationField/ErkLocationField.module.css +164 -0
  150. package/dist/Shared/ErkLocationField/ErkLocationField.test.d.ts +1 -0
  151. package/dist/Shared/ErkLocationField/ErkLocationField.test.js +82 -0
  152. package/dist/Shared/ErkLocationField/addressFields.d.ts +12 -0
  153. package/dist/Shared/ErkLocationField/addressFields.js +34 -0
  154. package/dist/Shared/ErkLocationField/locationRestrictions.d.ts +6 -0
  155. package/dist/Shared/ErkLocationField/locationRestrictions.js +51 -0
  156. package/dist/Shared/ErkLocationInput/ErkLocationInput.d.ts +15 -0
  157. package/dist/Shared/ErkLocationInput/ErkLocationInput.js +502 -0
  158. package/dist/Shared/ErkLocationInput/ErkLocationInput.module.css +128 -0
  159. package/dist/Shared/ErkNumberField/ErkNumberField.d.ts +42 -0
  160. package/dist/Shared/ErkNumberField/ErkNumberField.js +169 -0
  161. package/dist/Utils/AxiosWidget.js +9 -1
  162. package/dist/constants/FormStepTypes.d.ts +5 -1
  163. package/dist/constants/FormStepTypes.js +4 -0
  164. package/dist/index.lib.d.ts +4 -2
  165. package/dist/index.lib.js +3 -1
  166. package/dist/main.js +4 -1
  167. package/package.json +2 -1
@@ -0,0 +1,177 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import ErkBookingPicker from './ErkBookingPicker';
4
+ import { withFormStepProviders } from '../../FormSteps/@StoryDecorators/FormStepDecorator';
5
+ import { BookingMode, PersonSelectionMode } from '../../@Types/BookingFormStep';
6
+ const SLOTS = [
7
+ { id: 's-1', startTime: '09:00', endTime: '09:50', available: true },
8
+ { id: 's-3', startTime: '11:00', endTime: '11:50', available: true },
9
+ { id: 's-4', startTime: '14:00', endTime: '14:50', available: true },
10
+ { id: 's-6', startTime: '16:00', endTime: '16:50', available: true },
11
+ ];
12
+ function mockFetchSlots() {
13
+ return new Promise((resolve) => setTimeout(() => resolve(SLOTS), 300));
14
+ }
15
+ const PERSONS = [
16
+ { id: 'p-1', name: 'María González', role: 'Asesora' },
17
+ { id: 'p-2', name: 'Carlos Ruiz', role: 'Técnico' },
18
+ ];
19
+ /** Controlled wrapper so the picker's value is interactive in Storybook. */
20
+ function Interactive(args) {
21
+ const [value, setValue] = useState(args.value);
22
+ return (_jsx("div", { style: { maxWidth: 660 }, children: _jsx(ErkBookingPicker, { ...args, value: value, onChange: setValue }) }));
23
+ }
24
+ const meta = {
25
+ component: ErkBookingPicker,
26
+ tags: ['autodocs'],
27
+ decorators: [withFormStepProviders],
28
+ render: Interactive,
29
+ args: {
30
+ // Supplied by the Interactive wrapper; declared here so stories don't each repeat it.
31
+ onChange: () => undefined,
32
+ },
33
+ };
34
+ export default meta;
35
+ /** Full flow: person → date → time. */
36
+ export const WithPersonSelection = {
37
+ args: {
38
+ value: null,
39
+ label: 'Seleccionar cita',
40
+ description: 'Elige profesional, día y hora.',
41
+ durationMinutes: 50,
42
+ personSelectionMode: PersonSelectionMode.REQUIRED,
43
+ persons: PERSONS,
44
+ fetchSlots: mockFetchSlots,
45
+ },
46
+ };
47
+ /** Optional person — adds a "Cualquiera" option. */
48
+ export const PersonOptional = {
49
+ args: {
50
+ value: null,
51
+ label: 'Reservar turno',
52
+ description: 'Puedes elegir o dejar que asignemos.',
53
+ durationMinutes: 30,
54
+ personSelectionMode: PersonSelectionMode.OPTIONAL,
55
+ persons: PERSONS,
56
+ fetchSlots: mockFetchSlots,
57
+ },
58
+ };
59
+ /** No person selection → straight to date + time. */
60
+ export const NoPerson = {
61
+ args: {
62
+ value: null,
63
+ label: 'Seleccionar horario',
64
+ description: 'Elige tu día y hora.',
65
+ durationMinutes: 60,
66
+ personSelectionMode: PersonSelectionMode.NONE,
67
+ fetchSlots: mockFetchSlots,
68
+ },
69
+ };
70
+ /** The email comes from an earlier step of the form: the picker only asks for the name. */
71
+ export const EmailFromStep = {
72
+ args: {
73
+ value: null,
74
+ label: 'Agendar cita',
75
+ description: 'Elige y déjanos tu nombre.',
76
+ durationMinutes: 45,
77
+ personSelectionMode: PersonSelectionMode.OPTIONAL,
78
+ persons: PERSONS,
79
+ knownContact: { email: 'juan@correo.com' },
80
+ fetchSlots: mockFetchSlots,
81
+ },
82
+ };
83
+ /** Full config: name and email asked in the picker, lock notice, in-person mode and the organization clock. */
84
+ export const Complete = {
85
+ args: {
86
+ value: null,
87
+ label: 'Agendar cita',
88
+ description: 'Soporte postventa',
89
+ durationMinutes: 60,
90
+ bookingMode: BookingMode.IN_PERSON,
91
+ temporaryLockMinutes: 15,
92
+ personSelectionMode: PersonSelectionMode.OPTIONAL,
93
+ persons: PERSONS,
94
+ askEmail: true,
95
+ timeZone: 'America/Bogota',
96
+ fetchSlots: mockFetchSlots,
97
+ },
98
+ };
99
+ /** A hold that lapsed after it was made: the requester is sent back to the hours with the reason. */
100
+ export const Lapsed = {
101
+ args: {
102
+ value: null,
103
+ label: 'Agendar cita',
104
+ durationMinutes: 30,
105
+ personSelectionMode: PersonSelectionMode.NONE,
106
+ lapsed: 'Tu reserva venció; elige la hora de nuevo.',
107
+ fetchSlots: mockFetchSlots,
108
+ },
109
+ };
110
+ /** Already booked / read-only summary. */
111
+ export const ReadOnly = {
112
+ args: {
113
+ readOnly: true,
114
+ label: 'Cita confirmada',
115
+ durationMinutes: 50,
116
+ value: {
117
+ type: 'BOOKING_VALUE',
118
+ slotId: 's-3',
119
+ date: '2026-07-02',
120
+ startTime: '11:00',
121
+ endTime: '11:50',
122
+ personName: 'María González',
123
+ status: 'CONFIRMED',
124
+ },
125
+ },
126
+ };
127
+ /** Several event templates: the requester picks what they need first, and its duration rules the hours. */
128
+ export const PickEventTemplate = {
129
+ args: {
130
+ value: null,
131
+ label: 'Agendar cita',
132
+ description: 'Elige qué necesitas, el día y la hora.',
133
+ durationMinutes: 30,
134
+ bookingMode: BookingMode.VIRTUAL,
135
+ personSelectionMode: PersonSelectionMode.OPTIONAL,
136
+ persons: PERSONS,
137
+ eventTemplates: [
138
+ { id: 't-1', name: 'Valoración', description: 'Primera visita, sin costo.', durationMinutes: 30 },
139
+ {
140
+ id: 't-2',
141
+ name: 'Asesoría de crédito',
142
+ description: 'Revisamos tu caso con un asesor.',
143
+ durationMinutes: 45,
144
+ },
145
+ { id: 't-3', name: 'Firma de documentos', durationMinutes: 60, bookingMode: BookingMode.IN_PERSON },
146
+ ],
147
+ timeZone: 'America/Bogota',
148
+ fetchSlots: mockFetchSlots,
149
+ },
150
+ };
151
+ /** Booked with an event template: the summary names it with its duration. */
152
+ export const BookedWithEventTemplate = {
153
+ args: {
154
+ label: 'Agendar cita',
155
+ durationMinutes: 45,
156
+ value: {
157
+ type: 'BOOKING_VALUE',
158
+ date: '2026-07-02',
159
+ startTime: '11:00',
160
+ endTime: '11:45',
161
+ personName: 'María González',
162
+ status: 'PENDING',
163
+ eventTemplate: { name: 'Asesoría de crédito', durationMinutes: 45 },
164
+ },
165
+ },
166
+ };
167
+ /** The offer did not load: the entry card stays disabled and offers "Reintentar". */
168
+ export const OfferFailed = {
169
+ args: {
170
+ value: null,
171
+ label: 'Agendar cita',
172
+ durationMinutes: 30,
173
+ disabled: true,
174
+ loadError: 'No pudimos cargar los horarios.',
175
+ onRetryLoad: () => undefined,
176
+ },
177
+ };
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render, screen, waitFor } from '@testing-library/react';
3
+ import userEvent from '@testing-library/user-event';
4
+ import { composeStories } from '@storybook/react-vite';
5
+ import { describe, expect, it } from 'vitest';
6
+ import '@testing-library/jest-dom';
7
+ import { format } from 'date-fns';
8
+ import { es } from 'date-fns/locale';
9
+ import * as stories from './ErkBookingPicker.stories';
10
+ const { Complete } = composeStories(stories);
11
+ function clickableToday() {
12
+ return screen.getByRole('button', { name: format(new Date(), "EEEE d 'de' MMMM 'de' yyyy", { locale: es }) });
13
+ }
14
+ describe('ErkBookingPicker Complete story', () => {
15
+ it('opens the wizard in a modal, completes it, and reserving closes the modal leaving the summary', async () => {
16
+ const user = userEvent.setup();
17
+ render(_jsx(Complete, {}));
18
+ // Trigger → modal con el wizard
19
+ await user.click(screen.getByRole('button', { name: 'Agendar cita' }));
20
+ expect(await screen.findByRole('heading', { name: '¿Con quién quieres agendar?' })).toBeInTheDocument();
21
+ // Persona
22
+ await user.click(screen.getByText('María González'));
23
+ await user.click(screen.getByRole('button', { name: 'Siguiente' }));
24
+ // Día
25
+ await screen.findByRole('heading', { name: 'Elige un día' });
26
+ await user.click(clickableToday());
27
+ await user.click(screen.getByRole('button', { name: 'Siguiente' }));
28
+ // Hora (los slots del mock llegan con delay)
29
+ await screen.findByRole('heading', { name: 'Elige una hora' });
30
+ expect(screen.getByText(/^Horas en hora de Bogotá/)).toBeInTheDocument();
31
+ await user.click(await screen.findByRole('button', { name: /^09:00/ }));
32
+ await user.click(screen.getByRole('button', { name: 'Siguiente' }));
33
+ // Reservar
34
+ await screen.findByRole('heading', { name: 'Revisa y reserva tu horario' });
35
+ await user.type(screen.getByLabelText(/Nombre/), 'Juan Pérez');
36
+ await user.type(screen.getByLabelText(/Correo/), 'juan@correo.com');
37
+ await user.click(screen.getByRole('button', { name: 'Reservar' }));
38
+ // El modal se cierra y queda el resumen compacto con opción de cambiar
39
+ await waitFor(() => expect(screen.queryByRole('heading', { name: 'Revisa y reserva tu horario' })).not.toBeInTheDocument());
40
+ expect(screen.getByText(/09:00–09:50 · con María González/)).toBeInTheDocument();
41
+ expect(screen.getByText(/Envía el formulario para confirmar la cita/)).toBeInTheDocument();
42
+ expect(screen.getByRole('button', { name: 'Cambiar' })).toBeInTheDocument();
43
+ // "Cambiar" limpia el valor y vuelve al botón de agendar
44
+ await user.click(screen.getByRole('button', { name: 'Cambiar' }));
45
+ expect(screen.getByRole('button', { name: 'Agendar cita' })).toBeInTheDocument();
46
+ });
47
+ });
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';