Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pokornyd committed Apr 10, 2024
1 parent 6625cb4 commit 80a2ff0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions tests/integration/importExport/clean.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,19 @@ describe("clean command", () => {
it.concurrent(
"Cleans only entities specified in the include parameter.",
withTestEnvironment(async (environmentId) => {
const command = `clean -e=${environmentId} -k=${API_KEY} --include spaces contentItems taxonomies`;
const command = `clean -e=${environmentId} -k=${API_KEY} --include spaces contentItems contentTypes contentTypeSnippets workflows`;

await runCommand(command);

await expectSameEnvironments(environmentId, CLEAN_TEST_DATA_ENVIRONMENT_ID, {
exclude: ["spaces", "items", "taxonomies", "previewUrls"],
exclude: ["spaces", "items", "previewUrls", "types", "snippets", "workflows"],
});

await expectNoTaxonomies(environmentId);
await expectNoItems(environmentId);
await expectNoPreviewUrls(environmentId);
await expectNoSnippets(environmentId);
await expectNoTypes(environmentId, true);
await expectNoWorkflows(environmentId);
}, false),
);

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/importExport/utils/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const expectSameAllEnvData = (
has("taxonomies") && expect(sortByCodename(data1.taxonomies)).toStrictEqual(sortByCodename(data2.taxonomies));
has("assetFolders") && expect(data1.assetFolders).toStrictEqual(data2.assetFolders);
has("assets") && expect(sortByCodename(data1.assets)).toStrictEqual(sortByCodename(data2.assets));
has("roles") && expect(data1.roles).toStrictEqual(data2.roles);
has("roles") && expect(sortBy(data1.roles, r => r.name)).toStrictEqual(sortBy(data2.roles, r => r.name));
has("workflows") && expect(sortByCodename(data1.workflows)).toStrictEqual(sortByCodename(data2.workflows));
has("snippets") && expect(sortByCodename(data1.snippets)).toStrictEqual(sortByCodename(data2.snippets));
has("types") && expect(sortByCodename(data1.types)).toStrictEqual(sortByCodename(data2.types));
Expand Down

0 comments on commit 80a2ff0

Please sign in to comment.