From e0e334d2cfde0e61ee3301d2a82bf0312194ee00 Mon Sep 17 00:00:00 2001 From: "adam.zakrzewski" Date: Tue, 7 Nov 2023 16:33:13 +0100 Subject: [PATCH] applying shorten expression --- .../actions/src/tests/create-file-from-template.spec.ts | 2 +- projects/aca-playwright-shared/src/api/nodes-api.ts | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/e2e/playwright/actions/src/tests/create-file-from-template.spec.ts b/e2e/playwright/actions/src/tests/create-file-from-template.spec.ts index 6a5f93b468..1b8391b3c0 100644 --- a/e2e/playwright/actions/src/tests/create-file-from-template.spec.ts +++ b/e2e/playwright/actions/src/tests/create-file-from-template.spec.ts @@ -349,7 +349,7 @@ test.describe('Create file from template', () => { }); }); - test.describe('Folder created from template on Personal Files Libraries', () => { + test.describe('File created from template on Personal Files Libraries', () => { const randomLibraryName = `playwright-library-${Utils.random()}`; test.beforeAll(async ({ sitesApiAction, nodesApiAction }) => { diff --git a/projects/aca-playwright-shared/src/api/nodes-api.ts b/projects/aca-playwright-shared/src/api/nodes-api.ts index cb699064d3..fd9455c48b 100755 --- a/projects/aca-playwright-shared/src/api/nodes-api.ts +++ b/projects/aca-playwright-shared/src/api/nodes-api.ts @@ -356,9 +356,7 @@ export class NodesApi { } async createLinkToFileName(originalFileName: string, originalFileParentId: string, destinationParentId?: string): Promise { - if (!destinationParentId) { - destinationParentId = originalFileParentId; - } + destinationParentId = destinationParentId ?? originalFileParentId; try { const nodeId = await this.getNodeIdFromParent(originalFileName, originalFileParentId); @@ -371,9 +369,7 @@ export class NodesApi { } async createLinkToFolderName(originalFolderName: string, originalFolderParentId: string, destinationParentId?: string): Promise { - if (!destinationParentId) { - destinationParentId = originalFolderParentId; - } + destinationParentId = destinationParentId ?? originalFolderParentId; try { const nodeId = await this.getNodeIdFromParent(originalFolderName, originalFolderParentId);