From caaeb220ebbd5320d008c09859119d0e90702ee5 Mon Sep 17 00:00:00 2001 From: David Glick Date: Thu, 6 Feb 2025 11:18:18 -0800 Subject: [PATCH] aliases endpoint has a permission check in 6.1 --- packages/client/src/restapi/aliases/get.test.tsx | 3 ++- packages/client/src/restapi/aliases/get_list.test.tsx | 3 ++- packages/client/src/restapi/history/get.test.tsx | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/client/src/restapi/aliases/get.test.tsx b/packages/client/src/restapi/aliases/get.test.tsx index f49a54a0f6..7aea1c5a56 100644 --- a/packages/client/src/restapi/aliases/get.test.tsx +++ b/packages/client/src/restapi/aliases/get.test.tsx @@ -7,7 +7,8 @@ const cli = ploneClient.initialize({ apiPath: 'http://localhost:55001/plone', }); -const { getAliasesQuery } = cli; +const { login, getAliasesQuery } = cli; +await login({ username: 'admin', password: 'secret' }); describe('[GET] Aliases', () => { test('Hook - Successful', async () => { diff --git a/packages/client/src/restapi/aliases/get_list.test.tsx b/packages/client/src/restapi/aliases/get_list.test.tsx index b60a18e429..dcb35ee4a4 100644 --- a/packages/client/src/restapi/aliases/get_list.test.tsx +++ b/packages/client/src/restapi/aliases/get_list.test.tsx @@ -7,7 +7,8 @@ const cli = ploneClient.initialize({ apiPath: 'http://localhost:55001/plone', }); -const { getAliasesListQuery } = cli; +const { login, getAliasesListQuery } = cli; +await login({ username: 'admin', password: 'secret' }); describe('[GET] AliasesList', () => { test('Hook - Successful', async () => { diff --git a/packages/client/src/restapi/history/get.test.tsx b/packages/client/src/restapi/history/get.test.tsx index 924d540d46..c48a1f9c07 100644 --- a/packages/client/src/restapi/history/get.test.tsx +++ b/packages/client/src/restapi/history/get.test.tsx @@ -29,7 +29,9 @@ describe('[GET] History', () => { await waitFor(() => expect(result.current.isSuccess).toBe(true)); - expect(result.current.data?.[0].action).toBe('Create'); + expect(result.current.data?.[result.current.data?.length - 1].action).toBe( + 'Create', + ); }); test('Hook - Failure', async () => {