Skip to content

Commit

Permalink
fix failing jests and move heading to header slot
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed May 20, 2024
1 parent dd18c1e commit 55c011a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
8 changes: 4 additions & 4 deletions client/src/components/ActivityBar/ActivitySettings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ function testActivity(id, newOptions = {}) {
}

async function testSearch(wrapper, query, result) {
const searchField = wrapper.find("input");
searchField.element.value = query;
searchField.trigger("change");
await wrapper.vm.$nextTick();
await wrapper.setProps({ query });
const filtered = wrapper.findAll(activityItemSelector);
expect(filtered.length).toBe(result);
}
Expand All @@ -48,6 +45,9 @@ describe("ActivitySettings", () => {
wrapper = mount(mountTarget, {
localVue,
pinia,
props: {
query: "",
},
stubs: {
icon: { template: "<div></div>" },
},
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ActivityBar/ActivitySettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const activityStore = useActivityStore();
const { activities } = storeToRefs(activityStore);
const filteredActivities = computed(() => {
if (props.query.length > 0) {
if (props.query?.length > 0) {
const queryLower = props.query.toLowerCase();
const results = activities.value.filter((a: Activity) => {
const attributeValues = [a.title, a.description];
Expand Down
4 changes: 4 additions & 0 deletions client/src/components/admin/AdminPanel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jest.mock("@/composables/config", () => ({
})),
}));

jest.mock("vue-router/composables", () => ({
useRoute: jest.fn(() => ({})),
}));

function createTarget(propsData = {}) {
return mount(MountTarget, {
localVue,
Expand Down
4 changes: 3 additions & 1 deletion client/src/components/admin/AdminPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ const sections = computed(() => {

<template>
<ActivityPanel v-if="isConfigLoaded" title="Administration" go-to-all-title="Admin Home" href="/admin">
<h3>Galaxy Version {{ adminProperties.versionMajor }}</h3>
<template v-slot:header>
<h3>Galaxy Version {{ adminProperties.versionMajor }}</h3>
</template>
<div class="unified-panel-body">
<div class="toolMenuContainer">
<div class="toolSectionWrapper">
Expand Down

0 comments on commit 55c011a

Please sign in to comment.