fix: 复习详情返回按钮改为返回总览
This commit is contained in:
@@ -82,4 +82,18 @@ test.describe('Review page', () => {
|
||||
await expect(page.getByRole('button', { name: '重新加载' })).toBeVisible();
|
||||
await expect(page.getByText('暂无复习任务')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('详情页返回按钮为「返回总览」并回到复习总览', async ({ page }) => {
|
||||
await page.route('**/api/review/task/**', (route) =>
|
||||
route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ code: 200, data: [] }) }),
|
||||
);
|
||||
|
||||
await page.locator('.task-card').first().click();
|
||||
await expect(page).toHaveURL(/\/review\/detail\/task\/T001/, { timeout: 5000 });
|
||||
|
||||
const backBtn = page.locator('.head .back-btn');
|
||||
await expect(backBtn).toHaveText('← 返回总览');
|
||||
await backBtn.click();
|
||||
await expect(page).toHaveURL(/\/review$/, { timeout: 5000 });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user