Skip to content

Commit

Permalink
PB-35323 Ensure resource test factory does not contain any metadata a…
Browse files Browse the repository at this point in the history
…t the root of the resource
  • Loading branch information
cedricalfonsi committed Sep 10, 2024
1 parent 8cc0f5c commit ecdb910
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "passbolt-styleguide",
"version": "4.9.7-alpha.3",
"version": "4.9.7-alpha.4",
"license": "AGPL-3.0",
"copyright": "Copyright 2023 Passbolt SA",
"description": "Passbolt styleguide contains common styling assets used by the different sites, plugin, etc.",
Expand Down
17 changes: 15 additions & 2 deletions src/shared/models/entity/resource/resourceEntity.test.data.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {ownerPermissionDto, readPermissionDto, updatePermissionDto} from "../per
import {defaultFavoriteDto} from "../favorite/favoriteEntity.test.data";
import {
TEST_RESOURCE_TYPE_PASSWORD_AND_DESCRIPTION,
TEST_RESOURCE_TYPE_PASSWORD_DESCRIPTION_TOTP,
TEST_RESOURCE_TYPE_PASSWORD_DESCRIPTION_TOTP, TEST_RESOURCE_TYPE_PASSWORD_STRING,
TEST_RESOURCE_TYPE_TOTP
} from "../resourceType/resourceTypeEntity.test.data";
import {defaultUserDto} from "../user/userEntity.test.data";
Expand Down Expand Up @@ -124,14 +124,27 @@ export const resourceWithFavoriteDto = (data = {}) => {
});
};

export const resourceLegacyDto = (data = {}) => defaultResourceDto({
resource_type_id: TEST_RESOURCE_TYPE_PASSWORD_STRING,
...data
});

export const resourceWithTotpDto = (data = {}) => defaultResourceDto({
resource_type_id: TEST_RESOURCE_TYPE_PASSWORD_DESCRIPTION_TOTP,
...data
});

export const resourceStandaloneTotpDto = (data = {}) => defaultResourceDto({
resource_type_id: TEST_RESOURCE_TYPE_TOTP,
metadata: defaultResourceMetadataDto({username: null, resource_type_id: TEST_RESOURCE_TYPE_TOTP}),
metadata: defaultResourceMetadataDto({
resource_type_id: TEST_RESOURCE_TYPE_TOTP,
username: null,
}),
...data
});

export const resourceUnknownResourceTypeDto = (data = {}) => defaultResourceDto({
resource_type_id: uuidv4(),
...data
});

Expand Down

0 comments on commit ecdb910

Please sign in to comment.