Hide redeemed reset cards from the account menu

This commit is contained in:
2026-09-20 10:52:35 +08:00
parent c953126284
commit fba5880557
5 changed files with 84 additions and 21 deletions

View File

@@ -1,7 +1,7 @@
import { closeElectronApp, expect, getStableWindow, test } from './fixtures/electron';
test.describe('Account reset-card wallet', () => {
test('redeems an available card and refreshes the authoritative point balance', async ({ launchElectronApp }) => {
test('hides a redeemed card and refreshes the authoritative point balance', async ({ launchElectronApp }, testInfo) => {
const app = await launchElectronApp({ skipSetup: true });
try {
const page = await getStableWindow(app);
@@ -108,7 +108,10 @@ test.describe('Account reset-card wallet', () => {
await expect(page.getByTestId('sidebar-reset-card-card-e2e')).toContainText('可使用');
await expect(page.getByTestId('sidebar-reset-card-card-e2e')).toContainText('有效期至 2099-09-15');
await page.getByTestId('sidebar-reset-card-redeem-card-e2e').click();
await expect(page.getByTestId('sidebar-reset-card-card-e2e')).toContainText('已使用');
await expect(page.getByTestId('sidebar-reset-card-card-e2e')).toHaveCount(0);
await expect(page.getByTestId('sidebar-reset-cards-drawer')).toContainText('暂无未使用的重置卡。');
await expect(page.getByTestId('sidebar-reset-card-available-count')).toHaveCount(0);
await page.screenshot({ path: testInfo.outputPath('used-reset-card-hidden.png') });
await page.getByTestId('sidebar-account-usage-menuitem').click();
await expect(page.getByTestId('sidebar-weekly-token-points')).toContainText('500 / 500 点');