Skip to content

Commit bc6f888

Browse files
committed
Support React 18 in useCurrentColorScheme test
1 parent b5459e7 commit bc6f888

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/mui-system/src/cssVars/useCurrentColorScheme.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { expect } from 'chai';
33
import { spy } from 'sinon';
4-
import { createRenderer, fireEvent, act, screen } from '@mui/internal-test-utils';
4+
import { createRenderer, fireEvent, act, screen, reactMajor } from '@mui/internal-test-utils';
55
import {
66
DEFAULT_MODE_STORAGE_KEY,
77
DEFAULT_COLOR_SCHEME_STORAGE_KEY,
@@ -101,7 +101,7 @@ describe('useCurrentColorScheme', () => {
101101
const { container } = render(<Data />);
102102

103103
expect(container.firstChild.textContent).to.equal('light');
104-
expect(effectRunCount).to.equal(2);
104+
expect(effectRunCount).to.equal(reactMajor >= 19 ? 2 : 3);
105105
});
106106

107107
it('[noSsr] does not trigger a re-render', () => {

0 commit comments

Comments
 (0)