From 169ca891e69307b1d64cccc81de2baca0744e154 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 24 Nov 2025 02:58:50 -0800 Subject: [PATCH] . --- .../identity-service/test/app.e2e-spec.ts | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/backend/services/identity-service/test/app.e2e-spec.ts b/backend/services/identity-service/test/app.e2e-spec.ts index 3f4e0079..fe626ebf 100644 --- a/backend/services/identity-service/test/app.e2e-spec.ts +++ b/backend/services/identity-service/test/app.e2e-spec.ts @@ -152,7 +152,17 @@ describe('Identity Service E2E Tests', () => { .expect(200); expect(response.body.success).toBe(true); - expect(response.body.data.nickname).toBe('测试用户'); + expect(response.body.data.message).toBe('更新成功'); + + // 验证更新后的资料 + const profileResponse = await request(app.getHttpServer()) + .get('/api/v1/user/my-profile') + .set('Authorization', `Bearer ${accessToken}`) + .expect(200); + + expect(profileResponse.body.data.nickname).toBe('测试用户'); + expect(profileResponse.body.data.avatarUrl).toBe('https://example.com/avatar.jpg'); + expect(profileResponse.body.data.address).toBe('测试地址'); }); }); @@ -178,7 +188,7 @@ describe('Identity Service E2E Tests', () => { .send({ accountSequence, mnemonic, - deviceId: newDeviceId, + newDeviceId: newDeviceId, deviceName: '新设备', }) .expect(201); @@ -205,7 +215,7 @@ describe('Identity Service E2E Tests', () => { .send({ accountSequence, mnemonic, - deviceId: newDeviceId, + newDeviceId: newDeviceId, deviceName: '待删除设备', }) .expect(201); @@ -231,7 +241,7 @@ describe('Identity Service E2E Tests', () => { .send({ accountSequence, mnemonic, - deviceId: testDeviceId, + newDeviceId: testDeviceId, deviceName: `设备${i + 1}`, }) .expect(201); @@ -244,7 +254,7 @@ describe('Identity Service E2E Tests', () => { .send({ accountSequence, mnemonic, - deviceId: sixthDeviceId, + newDeviceId: sixthDeviceId, deviceName: '第6个设备', }) .expect(400); @@ -364,7 +374,7 @@ describe('Identity Service E2E Tests', () => { .send({ accountSequence, mnemonic, - deviceId: newDeviceId, + newDeviceId: newDeviceId, deviceName: '恢复设备', }) .expect(201); @@ -380,7 +390,7 @@ describe('Identity Service E2E Tests', () => { .send({ accountSequence, mnemonic: 'wrong wrong wrong wrong wrong wrong wrong wrong wrong wrong wrong wrong', - deviceId: `wrong-device-${Date.now()}`, + newDeviceId: `wrong-device-${Date.now()}`, deviceName: '错误设备', }) .expect(400); @@ -392,7 +402,7 @@ describe('Identity Service E2E Tests', () => { .send({ accountSequence: 999999, mnemonic, - deviceId: `mismatch-device-${Date.now()}`, + newDeviceId: `mismatch-device-${Date.now()}`, deviceName: '不匹配设备', }) .expect(404);