Skip to content

Commit 2f10728

Browse files
committed
test: 稳定设置页备份菜单测试
1 parent b333ec9 commit 2f10728

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

frontend/src/features/settings/SettingsPage.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ describe("SettingsPage", () => {
4848

4949
async function openBackupMenu(label = "备份操作 20260309-101500.000") {
5050
const trigger = await screen.findByRole("button", { name: label });
51+
await waitFor(() => {
52+
expect(trigger).not.toBeDisabled();
53+
});
5154
await act(async () => {
5255
fireEvent.click(trigger);
5356
});
@@ -364,6 +367,12 @@ describe("SettingsPage", () => {
364367
}),
365368
);
366369
});
370+
await waitFor(() => {
371+
expect(
372+
fetchMock.mock.calls.filter(([input, init]) => String(input) === "/ai-router/api/settings/database/backups" && (!init?.method || init.method === "GET"))
373+
.length,
374+
).toBeGreaterThanOrEqual(3);
375+
});
367376

368377
await act(async () => {
369378
await openBackupMenu();

0 commit comments

Comments
 (0)