Estoy tratando de ejecutar una prueba de broma existente después de que hice un cambio momentTimezone en el código. Creo que es porque mi cambio hace otro cambio de estado entre el despacho redux en el caso de prueba. No estoy seguro de cómo solucionarlo. El valor esperado es citaGroupState.isBookingLocked es falso en lugar de verdadero junto con este error: a continuación se muestra el código de broma donde se genera el error:
No detectado [Violación invariable: se detectó una mutación de estado entre envíos, en la ruta suggestionSearchCriteria.beginDate._locale._longDateFormat.l .
const recurViewPresenterComponentState = wrapper .find('RecurViewPresenter') .prop('recurViewPresenterComponentState'); const appointmentGroupState = recurViewPresenterComponentState.recurUIAppointmentGroupStates.find( ({ id }) => id === MockRecurUIComponentConfigurationMultipleApptGroups.appointmentGroups[0].uuid, ); **expect(appointmentGroupState.isBookingLocked).toBe(true);** });Aquí está mi fragmento de código principal: momentTimezone (patientDurationDisplay.beginDateTime); Acabo de agregar momentTimezone y la broma está fallando.
Aquí está el envío completo
const clickAppointmentTypeCard = (wrapper, apptTypeCardIndex) => { wrapper.find('.single-appointment-type-card-list > *').at(apptTypeCardIndex).simulate('click'); }; let wrapper; window.featureToggles = { getAllEnabledToggles: () => [], }; beforeEach(() => { wrapper = mountWithTestFileI18N( <RecurViewPresenter recurUIComponentConfiguration={ new RecurUIComponentConfiguration({ ...MockRecurUIComponentConfigurationMultipleApptGroups, appointmentGroups: [ { ...MockRecurUIComponentConfigurationMultipleApptGroups.appointmentGroups[0], appointmentGroupConfiguration: { ...MockRecurUIComponentConfigurationMultipleApptGroups.appointmentGroups[0] .appointmentGroupConfiguration, multipleAppointmentInstancesConfiguration: { numberOfAppointmentInstancesInADay: 1, hoursBetweenAppointmentInstancesInADay: 0, }, }, }, MockRecurUIComponentConfigurationMultipleApptGroups.appointmentGroups[1], ], }) } retrieveRecurringAppointmentSuggestions={() => createMockAppointmentGroupSuggestionResult()} onSuggestionsSelected={() => ({ bookingStatus: 'SUCCESS', lockReleaseStatus: 'SUCCESS', })} />, ); afterEach(() => { mockSuggestionResultsComponentSelection = { ...mockSuggestionResultsComponentSelection, instanceIndex: 1, }; }); ```