| 12345678910111213141516171819202122232425 |
- /**
- * L2 回归测试:通知系统
- */
- import { test, expect } from '@playwright/test';
- import { apiGet, apiPut, initApiClient, disposeApiClient } from '../helpers/api-client';
- test.describe('通知系统 (Notifications)', () => {
- test.beforeAll(async () => { await initApiClient(); });
- test.afterAll(async () => { await disposeApiClient(); });
- test('N01: 获取通知列表 GET /api/notifications', async () => {
- const res = await apiGet('/api/notifications');
- expect(res.code).toBe(0);
- });
- test('N02: 标记已读 PUT /api/notifications/read', async () => {
- const res = await apiPut('/api/notifications/read', { id: '1' });
- expect([0, 404]).toContain(res.code);
- });
- test('N03: 获取未读数量 GET /api/notifications/unread-count', async () => {
- const res = await apiGet('/api/notifications/unread-count');
- expect([0, 404]).toContain(res.code);
- });
- });
|