From b7d1b6645b84745c7a38cfa994ae7571e69c223b Mon Sep 17 00:00:00 2001 From: ryjiang Date: Tue, 3 Sep 2024 09:48:25 +0800 Subject: [PATCH] fix test Signed-off-by: ryjiang --- test/grpc/User.spec.ts | 8 ++++++-- test/tools/ip.ts | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/grpc/User.spec.ts b/test/grpc/User.spec.ts index 6719d5f1..52f30f7b 100644 --- a/test/grpc/User.spec.ts +++ b/test/grpc/User.spec.ts @@ -76,7 +76,9 @@ describe(`User Api`, () => { password: PASSWORD, }); const res = await authClient.listUsers(); - expect(res.usernames).toEqual(['root', USERNAME]); + expect(res.usernames).toContain(USERNAME); + expect(res.usernames).toContain('root'); + expect(res.usernames.length).toEqual(2); }); it(`Auth client with token expect success`, async () => { @@ -86,7 +88,9 @@ describe(`User Api`, () => { token: `${USERNAME}:${PASSWORD}`, }); const res = await authClient.listUsers(); - expect(res.usernames).toEqual(['root', USERNAME]); + expect(res.usernames).toContain(USERNAME); + expect(res.usernames).toContain('root'); + expect(res.usernames.length).toEqual(2); }); it(`Clean all role privileges`, async () => { diff --git a/test/tools/ip.ts b/test/tools/ip.ts index 2fec5d91..57cbbcca 100644 --- a/test/tools/ip.ts +++ b/test/tools/ip.ts @@ -1,3 +1,3 @@ // test IP -export const IP = '127.0.0.1:19530'; +export const IP = '10.102.7.11:19530'; export const ENDPOINT = `http://${IP}`;