Skip to content

Commit

Permalink
Fix for potentially empty badge messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed May 5, 2023
1 parent 348fe35 commit 92581cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions client/src/components/ObjectStore/ObjectStoreBadge.test.js
Expand Up @@ -39,4 +39,14 @@ describe("ObjectStoreBadge", () => {
expect(popoverText).toContain(TEST_MESSAGE);
expect(popoverText).toContain("less secure by the Galaxy administrator");
});

it("should gracefully unspecified badge messages", async () => {
mountBadge({ type: "more_secure", message: null });
const selector = ROOT_COMPONENT.object_store_details.badge_of_type({ type: "more_secure" }).selector;
const iconEl = wrapper.find(selector);
expect(iconEl.exists()).toBeTruthy();
const popoverStub = wrapper.find("b-popover-stub");
expect(popoverStub.exists()).toBe(true);
});

});
2 changes: 1 addition & 1 deletion client/src/components/ObjectStore/ObjectStoreBadge.vue
Expand Up @@ -135,7 +135,7 @@ const message = computed(() => {
placement="bottom"
class="object-store-badge-popover">
<p v-localize>{{ stockMessage }}</p>
<ConfigurationMarkdown :markdown="message" :admin="true" />
<ConfigurationMarkdown v-if="message" :markdown="message" :admin="true" />
</b-popover>
</span>
</template>
Expand Down

0 comments on commit 92581cc

Please sign in to comment.