Skip to content

Commit

Permalink
[ACS-8951] review fix 3
Browse files Browse the repository at this point in the history
  • Loading branch information
datguychen committed Nov 5, 2024
1 parent 516e6df commit 513528f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions e2e/playwright/info-drawer/src/tests/file-folder-properties.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,21 @@ test.describe('Info Drawer - File Folder Properties', () => {
const noTagsText = 'There are currently no tags added';

async function createCategoryGetId(): Promise<string> {
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<string> {
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;
}
}
Expand All @@ -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);
Expand Down

0 comments on commit 513528f

Please sign in to comment.