-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/PB-35256_WP2-52-Unit-test-performance-of-new-co…
…llection-v2-and-ensure-no-regression-is-introduced' into 'develop' PB-35256 WP2-5.2 Unit test performance of new collection v2 and ensure no regression is introduced See merge request passbolt/passbolt-styleguide!1774
- Loading branch information
Showing
6 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/shared/models/entity/folder/foldersCollection.test.data.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Passbolt ~ Open source password manager for teams | ||
* Copyright (c) Passbolt SA (https://www.passbolt.com) | ||
* | ||
* Licensed under GNU Affero General Public License version 3 of the or any later version. | ||
* For full copyright and license information, please see the LICENSE.txt | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com) | ||
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License | ||
* @link https://www.passbolt.com Passbolt(tm) | ||
* @since 4.9.4 | ||
*/ | ||
import {defaultFolderDto} from "./folderEntity.test.data"; | ||
|
||
/** | ||
* Build dtos. | ||
* @param {number} [foldersCount=10] The number of dtos. | ||
* @param {object} [data] | ||
* @returns {object} | ||
*/ | ||
export const defaultFoldersCollectionDto = (foldersCount = 10, data = {}) => { | ||
const dtos = []; | ||
for (let i = 0; i < foldersCount; i++) { | ||
const dto = defaultFolderDto({name: `folder ${i}`, ...data}); | ||
dtos.push(dto); | ||
} | ||
return dtos; | ||
}; | ||
|
30 changes: 30 additions & 0 deletions
30
src/shared/models/entity/group/groupUserTransfersCollection.test.data.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Passbolt ~ Open source password manager for teams | ||
* Copyright (c) Passbolt SA (https://www.passbolt.com) | ||
* | ||
* Licensed under GNU Affero General Public License version 3 of the or any later version. | ||
* For full copyright and license information, please see the LICENSE.txt | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com) | ||
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License | ||
* @link https://www.passbolt.com Passbolt(tm) | ||
* @since 4.9.4 | ||
*/ | ||
import {defaultUserTransferDto} from "./groupTransfer.test.data"; | ||
|
||
/** | ||
* Default user transfers collection | ||
* @param {number} [userTransferCount = 10] number of user transfer dto | ||
* @param {object} [data] The data to override properties | ||
* @returns {*[]} | ||
*/ | ||
export const defaultUserTransfersCollectionDto = (userTransferCount = 10, data = {}) => { | ||
const dtos = []; | ||
for (let i = 0; i < userTransferCount; i++) { | ||
const dto = defaultUserTransferDto(data); | ||
dtos.push(dto); | ||
} | ||
return dtos; | ||
}; | ||
|
29 changes: 29 additions & 0 deletions
29
src/shared/models/entity/permission/permissionTransfersCollection.test.data.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Passbolt ~ Open source password manager for teams | ||
* Copyright (c) Passbolt SA (https://www.passbolt.com) | ||
* | ||
* Licensed under GNU Affero General Public License version 3 of the or any later version. | ||
* For full copyright and license information, please see the LICENSE.txt | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com) | ||
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License | ||
* @link https://www.passbolt.com Passbolt(tm) | ||
* @since 4.9.4 | ||
*/ | ||
|
||
import {defaultPermissionTransferDto} from "./permissionTransferEntity.test.data"; | ||
|
||
/** | ||
* Build permission transfers collection dtos. | ||
* @param {number} [permissionTransferCount=10] The number of permission transfer. | ||
* @returns {object} | ||
*/ | ||
export const defaultPermissionTransfersCollectionDtos = (permissionTransferCount = 10) => { | ||
const dtos = []; | ||
for (let i = 0; i < permissionTransferCount; i++) { | ||
const dto = defaultPermissionTransferDto(); | ||
dtos.push(dto); | ||
} | ||
return dtos; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/shared/models/entity/secret/neededSecretCollection.test.data.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Passbolt ~ Open source password manager for teams | ||
* Copyright (c) Passbolt SA (https://www.passbolt.com) | ||
* | ||
* Licensed under GNU Affero General Public License version 3 of the or any later version. | ||
* For full copyright and license information, please see the LICENSE.txt | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com) | ||
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License | ||
* @link https://www.passbolt.com Passbolt(tm) | ||
* @since 4.9.4 | ||
*/ | ||
|
||
import {defaultNeededSecretDto} from "./neededSecretEntity.test.data"; | ||
|
||
/** | ||
* Build dtos. | ||
* @param {number} [count=10] The number of dtos. | ||
* @param {object} [data] The data to override the default dto. | ||
* @returns {object} | ||
*/ | ||
export const defaultNeededSecretsDtos = (count = 10, data = {}) => { | ||
const dtos = []; | ||
for (let i = 0; i < count; i++) { | ||
const dto = defaultNeededSecretDto(data); | ||
dtos.push(dto); | ||
} | ||
return dtos; | ||
}; | ||
|