From 513528fd00b2b0177aa04ca52d9c8b7440f7b4f6 Mon Sep 17 00:00:00 2001 From: datguychen Date: Thu, 31 Oct 2024 11:28:35 +0100 Subject: [PATCH] [ACS-8951] review fix 3 --- .../src/tests/file-folder-properties.e2e.ts | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/e2e/playwright/info-drawer/src/tests/file-folder-properties.e2e.ts b/e2e/playwright/info-drawer/src/tests/file-folder-properties.e2e.ts index 4cb5d2bd56..d2f8d2ffaa 100755 --- a/e2e/playwright/info-drawer/src/tests/file-folder-properties.e2e.ts +++ b/e2e/playwright/info-drawer/src/tests/file-folder-properties.e2e.ts @@ -63,21 +63,21 @@ test.describe('Info Drawer - File Folder Properties', () => { const noTagsText = 'There are currently no tags added'; async function createCategoryGetId(): Promise { - const requestData = await categoriesApi.createCategory(`-root-`, [{ name: categoryName }]); - if ('entry' in requestData) { - return requestData.entry.id; + const createdCategory = await categoriesApi.createCategory(`-root-`, [{ name: categoryName }]); + if ('entry' in createdCategory) { + return createdCategory.entry.id; } else { - console.error('Unexpected response format:', requestData); + console.error('Unexpected response format:', createdCategory); return null; } } async function createTagGetId(): Promise { - const requestTagData = await tagsApi.createTags([tagBody]); - if ('entry' in requestTagData) { - return (requestTagData as { entry: { id: string } }).entry.id; + const createdTag = await tagsApi.createTags([tagBody]); + if ('entry' in createdTag) { + return (createdTag as { entry: { id: string } }).entry.id; } else { - console.error('Unexpected response format:', requestTagData); + console.error('Unexpected response format:', createdTag); return null; } } @@ -95,6 +95,10 @@ test.describe('Info Drawer - File Folder Properties', () => { responseCategoryId = await createCategoryGetId(); responseTagsId = await createTagGetId(); + if (responseCategoryId === null || responseTagsId === null) { + throw new Error('Failed to create category or tag - check API manually'); + } + await nodesApi.createFolder(FolderC299162); await nodesApi.createFolder(FolderC599174); await nodesApi.createFolder(Folder17238);