Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion web/src/pages/org/depts/DeptsPage.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@douyinfe/semi-ui/react19-adapter';

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { render, screen, within } from '@testing-library/react';
import { render, screen, waitFor, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { MemoryRouter } from 'react-router';
import { afterEach, describe, expect, it } from 'vitest';
Expand Down Expand Up @@ -63,6 +63,15 @@ describe('DeptsPage', () => {
await userEvent.click(within(row as HTMLElement).getByRole('button', { name: '更多' }));
const remove = await screen.findByText('删除');
expect(remove.closest('[aria-disabled="true"]')).not.toBeNull();
// 浮层「插入 → 定位 → 可见」靠 insertPortal 的 100ms 安全网定时器推进(jsdom 无布局、
// ResizeObserver 空桩);链路未走完就结束测试,卸载后挂起定时器仍触发,偶发抛 unhandled
// error(CI 记录 nodeType of null)。aria-expanded 是链路最末端信号,等到它即耗尽挂起定时器。
await waitFor(() => {
expect(within(row as HTMLElement).getByRole('button', { name: '更多' })).toHaveAttribute(
'aria-expanded',
'true',
);
});
});

it('hides write controls for view-only accounts', async () => {
Expand Down
Loading