[ACS-5688] create folder tests update (#3519)

* [ACS-5688] create folder tests update

* fixes for comments

* short expression
This commit is contained in:
Adam Zakrzewski
2023-11-14 15:44:08 +01:00
committed by GitHub
parent 4877a0549b
commit 7a0d21cfd2
5 changed files with 101 additions and 112 deletions

View File

@@ -136,6 +136,20 @@ export class NodesApi {
}
}
/**
* Delete all nodes of the currently logged in user
* @param userNodeId The id of User node, all child nodes of "userNodeId" will be gathered as a list and deleted ( e.g.: "-my-" - User Homes folder)
*/
async deleteCurrentUserNodes(): Promise<void> {
try {
const userNodes = (await this.getNodeChildren('-my-')).list.entries;
const userNodesIds = userNodes.map((nodeChild) => nodeChild.entry.id);
await this.deleteNodes(userNodesIds);
} catch (error) {
logger.error(`${this.constructor.name} ${this.deleteCurrentUserNodes.name}`, error);
}
}
async lockNodes(nodeIds: string[], lockType: string = 'ALLOW_OWNER_CHANGES') {
try {
for (const nodeId of nodeIds) {
@@ -356,7 +370,7 @@ export class NodesApi {
}
async createLinkToFileName(originalFileName: string, originalFileParentId: string, destinationParentId?: string): Promise<NodeEntry> {
destinationParentId = destinationParentId ?? originalFileParentId;
destinationParentId ??= originalFileParentId;
try {
const nodeId = await this.getNodeIdFromParent(originalFileName, originalFileParentId);
@@ -369,7 +383,7 @@ export class NodesApi {
}
async createLinkToFolderName(originalFolderName: string, originalFolderParentId: string, destinationParentId?: string): Promise<NodeEntry> {
destinationParentId = destinationParentId ?? originalFolderParentId;
destinationParentId ??= originalFolderParentId;
try {
const nodeId = await this.getNodeIdFromParent(originalFolderName, originalFolderParentId);

View File

@@ -31,6 +31,11 @@ export const errorStrings = {
nameContainOnlySpacesError: `Name can't contain only spaces`,
titleLengthLimitError: 'Use 256 characters or less for title',
descriptionLengthLimitError: 'Use 512 characters or less for description',
nameAlreadyUsedError: 'This name is already in use, try a different name.'
nameAlreadyUsedError: 'This name is already in use, try a different name.',
folderNameIsRequired: 'Folder name is required',
folderNameCantEndWithAPeriod: `Folder name can't end with a period .`,
folderNameCantContainTheseCharacters: `Folder name can't contain these characters`,
folderNameCantContainOnlySpaces: `Folder name can't contain only spaces`,
thereIsAlreadyAFolderWithThisName: `There's already a folder with this name. Try a different name.`
}

View File

@@ -1,31 +0,0 @@
/*!
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Alfresco Example Content Application
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
export const folderErrors = {
folderNameIsRequired: 'Folder name is required',
folderNameCantEndWithAPeriod: `Folder name can't end with a period .`,
folderNameCantContainTheseCharacters: `Folder name can't contain these characters`,
folderNameCantContainOnlySpaces: `Folder name can't contain only spaces`,
thereIsAlreadyAFolderWithThisName: `There's already a folder with this name. Try a different name.`
}

View File

@@ -26,7 +26,6 @@ export * from './paths';
export * from './timeouts';
export * from './exclude-tests';
export * from './state-helper';
export * from './folder-errors';
export * from './utils';
export * from './library-errors';
export * from './config';