fix failing jests and move heading to header slot

This commit is contained in:
Ahmed Awan
2024-05-20 15:02:04 -05:00
parent dd18c1eef5
commit 55c011a326
4 changed files with 12 additions and 6 deletions
@@ -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);
}
@@ -48,6 +45,9 @@ describe("ActivitySettings", () => {
wrapper = mount(mountTarget, {
localVue,
pinia,
props: {
query: "",
},
stubs: {
icon: { template: "<div></div>" },
},
@@ -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];
@@ -14,6 +14,10 @@ jest.mock("@/composables/config", () => ({
})),
}));
jest.mock("vue-router/composables", () => ({
useRoute: jest.fn(() => ({})),
}));
function createTarget(propsData = {}) {
return mount(MountTarget, {
localVue,
+3 -1
View File
@@ -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">