From f2be254d41e92c471ad8d46d538710a7ece6b90e Mon Sep 17 00:00:00 2001 From: ryjiang Date: Tue, 24 Dec 2024 16:37:26 +0800 Subject: [PATCH] add more tests Signed-off-by: ryjiang --- test/grpc/User.spec.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/grpc/User.spec.ts b/test/grpc/User.spec.ts index 839f5b6c..46d5677b 100644 --- a/test/grpc/User.spec.ts +++ b/test/grpc/User.spec.ts @@ -1,3 +1,4 @@ +import exp from 'constants'; import { MilvusClient, ERROR_REASONS, @@ -6,6 +7,7 @@ import { Roles, Privileges, RbacObjects, + OperatePrivilegeGroupType, } from '../../milvus'; import { timeoutTest } from '../tools'; import { IP, genCollectionParams, GENERATE_NAME } from '../tools'; @@ -291,10 +293,17 @@ describe(`User Api`, () => { it(`add privileges to a privilege group`, async () => { const res = await authClient.addPrivilegesToGroup({ group_name: PRIVILEGE_GRP_NAME, - privileges: [Privileges.Search, Privileges.Query], + privileges: [Privileges.Query], }); expect(res.error_code).toEqual(ErrorCode.SUCCESS); + + const res2 = await authClient.operatePrivilegeGroup({ + group_name: PRIVILEGE_GRP_NAME, + privileges: [{ name: Privileges.Search }], + type: OperatePrivilegeGroupType.AddPrivilegesToGroup, + }); + expect(res2.error_code).toEqual(ErrorCode.SUCCESS); }); it(`remove privileges from a privilege group`, async () => { @@ -312,7 +321,7 @@ describe(`User Api`, () => { g => g.group_name === PRIVILEGE_GRP_NAME )!; expect(grp.group_name).toEqual(PRIVILEGE_GRP_NAME); - expect(grp.privileges.map(p => p.name)).toContain( Privileges.Search); + expect(grp.privileges.map(p => p.name)).toContain(Privileges.Search); }); it(`drop a privilege group`, async () => {