Skip to content

Commit

Permalink
refactor: coder review problem modification
Browse files Browse the repository at this point in the history
  • Loading branch information
huangguang1999 committed Feb 27, 2024
1 parent 7c9a087 commit 2f160e4
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Button from '../../button';
import { defaultContext } from '../../context-provider';

const prefix = `${defaultContext.prefixCls}-dropdown`;
const buttonPrefix = `${defaultContext.prefixCls}-button`;

const options = [
{
Expand Down Expand Up @@ -53,7 +54,7 @@ test('should open correctly', async () => {
<TestDemo />
);
expect(document.querySelector(`.${prefix}`)).toBeNull();
fireEvent.click(container.querySelector(`.arco-button`));
fireEvent.click(container.querySelector(`.${buttonPrefix}`));

await waitFor(
() => {
Expand All @@ -68,11 +69,11 @@ test('can be properly closed', async () => {
<TestDemo />
);
expect(document.querySelector(`.${prefix}`)).toBeNull();
fireEvent.click(container.querySelector(`.arco-button`));
fireEvent.click(container.querySelector(`.${buttonPrefix}`));

await waitFor(
() => {
fireEvent.click(container.querySelector(`.arco-button`));
fireEvent.click(container.querySelector(`.${buttonPrefix}`));
},
{ timeout: 1000 },
);
Expand Down

0 comments on commit 2f160e4

Please sign in to comment.