|
2 | 2 | import * as React from 'react';
|
3 | 3 | import { expect } from 'chai';
|
4 | 4 | import { spy } from 'sinon';
|
5 |
| -import { createRenderer, act, describeSkipIf } from '@mui/internal-test-utils'; |
| 5 | +import { act, describeSkipIf, flushMicrotasks } from '@mui/internal-test-utils'; |
6 | 6 | import { Collapsible } from '@base_ui/react/Collapsible';
|
7 |
| -import { describeConformance } from '../../../test/describeConformance'; |
| 7 | +import { createRenderer, describeConformance } from '#test-utils'; |
8 | 8 |
|
9 | 9 | describe('<Collapsible.Root />', () => {
|
10 | 10 | const { render } = createRenderer();
|
@@ -51,13 +51,15 @@ describe('<Collapsible.Root />', () => {
|
51 | 51 | expect(panel).not.toBeVisible();
|
52 | 52 |
|
53 | 53 | setProps({ open: true });
|
| 54 | + await flushMicrotasks(); |
54 | 55 |
|
55 | 56 | expect(trigger).to.have.attribute('aria-expanded', 'true');
|
56 | 57 | expect(panel).toBeVisible();
|
57 | 58 | expect(panel).to.have.attribute('data-open');
|
58 | 59 | expect(trigger).to.have.attribute('data-panel-open');
|
59 | 60 |
|
60 | 61 | setProps({ open: false });
|
| 62 | + await flushMicrotasks(); |
61 | 63 |
|
62 | 64 | expect(trigger).to.have.attribute('aria-expanded', 'false');
|
63 | 65 | expect(panel).not.toBeVisible();
|
|
0 commit comments