This commit is contained in:
parent
0b1defb78b
commit
169ca891e6
|
|
@ -152,7 +152,17 @@ describe('Identity Service E2E Tests', () => {
|
||||||
.expect(200);
|
.expect(200);
|
||||||
|
|
||||||
expect(response.body.success).toBe(true);
|
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({
|
.send({
|
||||||
accountSequence,
|
accountSequence,
|
||||||
mnemonic,
|
mnemonic,
|
||||||
deviceId: newDeviceId,
|
newDeviceId: newDeviceId,
|
||||||
deviceName: '新设备',
|
deviceName: '新设备',
|
||||||
})
|
})
|
||||||
.expect(201);
|
.expect(201);
|
||||||
|
|
@ -205,7 +215,7 @@ describe('Identity Service E2E Tests', () => {
|
||||||
.send({
|
.send({
|
||||||
accountSequence,
|
accountSequence,
|
||||||
mnemonic,
|
mnemonic,
|
||||||
deviceId: newDeviceId,
|
newDeviceId: newDeviceId,
|
||||||
deviceName: '待删除设备',
|
deviceName: '待删除设备',
|
||||||
})
|
})
|
||||||
.expect(201);
|
.expect(201);
|
||||||
|
|
@ -231,7 +241,7 @@ describe('Identity Service E2E Tests', () => {
|
||||||
.send({
|
.send({
|
||||||
accountSequence,
|
accountSequence,
|
||||||
mnemonic,
|
mnemonic,
|
||||||
deviceId: testDeviceId,
|
newDeviceId: testDeviceId,
|
||||||
deviceName: `设备${i + 1}`,
|
deviceName: `设备${i + 1}`,
|
||||||
})
|
})
|
||||||
.expect(201);
|
.expect(201);
|
||||||
|
|
@ -244,7 +254,7 @@ describe('Identity Service E2E Tests', () => {
|
||||||
.send({
|
.send({
|
||||||
accountSequence,
|
accountSequence,
|
||||||
mnemonic,
|
mnemonic,
|
||||||
deviceId: sixthDeviceId,
|
newDeviceId: sixthDeviceId,
|
||||||
deviceName: '第6个设备',
|
deviceName: '第6个设备',
|
||||||
})
|
})
|
||||||
.expect(400);
|
.expect(400);
|
||||||
|
|
@ -364,7 +374,7 @@ describe('Identity Service E2E Tests', () => {
|
||||||
.send({
|
.send({
|
||||||
accountSequence,
|
accountSequence,
|
||||||
mnemonic,
|
mnemonic,
|
||||||
deviceId: newDeviceId,
|
newDeviceId: newDeviceId,
|
||||||
deviceName: '恢复设备',
|
deviceName: '恢复设备',
|
||||||
})
|
})
|
||||||
.expect(201);
|
.expect(201);
|
||||||
|
|
@ -380,7 +390,7 @@ describe('Identity Service E2E Tests', () => {
|
||||||
.send({
|
.send({
|
||||||
accountSequence,
|
accountSequence,
|
||||||
mnemonic: 'wrong wrong wrong wrong wrong wrong wrong wrong wrong wrong wrong wrong',
|
mnemonic: 'wrong wrong wrong wrong wrong wrong wrong wrong wrong wrong wrong wrong',
|
||||||
deviceId: `wrong-device-${Date.now()}`,
|
newDeviceId: `wrong-device-${Date.now()}`,
|
||||||
deviceName: '错误设备',
|
deviceName: '错误设备',
|
||||||
})
|
})
|
||||||
.expect(400);
|
.expect(400);
|
||||||
|
|
@ -392,7 +402,7 @@ describe('Identity Service E2E Tests', () => {
|
||||||
.send({
|
.send({
|
||||||
accountSequence: 999999,
|
accountSequence: 999999,
|
||||||
mnemonic,
|
mnemonic,
|
||||||
deviceId: `mismatch-device-${Date.now()}`,
|
newDeviceId: `mismatch-device-${Date.now()}`,
|
||||||
deviceName: '不匹配设备',
|
deviceName: '不匹配设备',
|
||||||
})
|
})
|
||||||
.expect(404);
|
.expect(404);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue