Skip to content

Commit

Permalink
try to flush microtasks before testing popper.js
Browse files Browse the repository at this point in the history
  • Loading branch information
VasilyStrelyaev committed Nov 17, 2023
1 parent f5283e5 commit 502a4bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import { mount } from 'enzyme';
import { setupConsole } from '@devexpress/dx-testing';
import { act } from 'react-dom/test-utils';
import Demo from './<%&demoName%>';

setupConsole();
Expand All @@ -17,7 +18,9 @@ window.fetch = jest.fn().mockImplementation(() => new Promise(() => {}));
// eslint-disable-next-line
window.__MUI_USE_NEXT_TYPOGRAPHY_VARIANTS__ = true;

it('should not fail', () => {
it('should not fail', async () => {
expect(() => { mount(<Demo />); })
.not.toThrow();

await act(async () => {});
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import { mount } from 'enzyme';
import { setupConsole } from '@devexpress/dx-testing';
import { act } from 'react-dom/test-utils';
import Demo from './<%&demoName%>';

setupConsole();
Expand All @@ -16,7 +17,9 @@ jest.spyOn((Element.prototype as any), 'getBBox').mockImplementation(() => ({
window.fetch = jest.fn().mockImplementation(() => new Promise(() => { /**/ }));
(window as any).__MUI_USE_NEXT_TYPOGRAPHY_VARIANTS__ = true;

it('should not fail', () => {
it('should not fail', async () => {
expect(() => { mount(<Demo />); })
.not.toThrow();

await act(async () => {});
});

0 comments on commit 502a4bd

Please sign in to comment.