Skip to content

Commit

Permalink
Wrap setProps in act as it causes a Transition
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasTy committed Sep 6, 2024
1 parent b4acf71 commit dd06429
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { expect } from 'chai';
import { screen, createRenderer } from '@mui/internal-test-utils';
import { screen, createRenderer, act } from '@mui/internal-test-utils';
import { DateCalendar, dayCalendarClasses } from '@mui/x-date-pickers/DateCalendar';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { createPickerRenderer, AdapterName, availableAdapters } from 'test/utils/pickers';
Expand Down Expand Up @@ -39,8 +39,10 @@ describe('<DateCalendar /> - localization', () => {
'Sunday',
);

setProps({
adapterLocale: adapterName === 'date-fns' ? fr : 'fr',
act(() => {
setProps({
adapterLocale: adapterName === 'date-fns' ? fr : 'fr',
});
});

expect(document.querySelector(`.${dayCalendarClasses.weekDayLabel}`)!.ariaLabel).to.equal(
Expand Down

0 comments on commit dd06429

Please sign in to comment.