Skip to content

Commit

Permalink
Ensure all cases are covered
Browse files Browse the repository at this point in the history
  • Loading branch information
amattu2 committed Oct 15, 2024
1 parent 3fae1a5 commit 9a92547
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/utils/dataModelUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ describe("buildAssetUrls cases", () => {
expect(result.readme).toEqual(null);
});

it("should use GenericModelLogo if model-navigator-logo is not provided", () => {
it("should use GenericModelLogo if model-navigator-logo is not defined", () => {
const dc: DataCommon = {
name: "test-name",
assets: {
Expand All @@ -159,6 +159,25 @@ describe("buildAssetUrls cases", () => {
"prop-file": "prop-file",
"readme-file": "readme-file",
"loading-file": "loading-file-zip-name",
// "model-navigator-logo" - not defined, aka no logo
} as ManifestAssets,
} as DataCommon;

const result = utils.buildAssetUrls(dc);

expect(result.navigator_icon).toEqual("genericLogo.png");
});

it("should use GenericModelLogo if the model-navigator-logo is an empty string", () => {
const dc: DataCommon = {
name: "test-name",
assets: {
"current-version": "1.0",
"model-file": "model-file",
"prop-file": "prop-file",
"readme-file": "readme-file",
"loading-file": "loading-file-zip-name",
"model-navigator-logo": "", // empty string - aka no logo
} as ManifestAssets,
} as DataCommon;

Expand All @@ -176,7 +195,7 @@ describe("buildAssetUrls cases", () => {
"prop-file": "prop-file",
"readme-file": "readme-file",
"loading-file": "loading-file-zip-name",
"model-navigator-logo": "custom-logo.png",
"model-navigator-logo": "custom-logo.png", // defined - must exist
} as ManifestAssets,
} as DataCommon;

Expand Down

0 comments on commit 9a92547

Please sign in to comment.