diff --git a/src/components/templates/DefaultWireframe.unit.ts b/src/components/templates/DefaultWireframe.unit.ts index 3d65312611..5b0e51f57d 100644 --- a/src/components/templates/DefaultWireframe.unit.ts +++ b/src/components/templates/DefaultWireframe.unit.ts @@ -8,6 +8,7 @@ import { } from "@@/tests/test-utils/setup"; import { ComponentMountingOptions, mount } from "@vue/test-utils"; import DefaultWireframe from "../templates/DefaultWireframe.vue"; +import { nextTick } from "vue"; describe("DefaultWireframe", () => { const setup = ( @@ -44,6 +45,7 @@ describe("DefaultWireframe", () => { props: { fullWidth: true, headline: "dummy title", + maxWidth: "full", breadcrumbs: [ { title: "dummy breadcrumb 1", @@ -109,7 +111,7 @@ describe("DefaultWireframe", () => { it("displays headline in slot", () => { const wrapper = setup({ - props: { headline: "property title", fullWidth: false }, + props: { headline: "property title", fullWidth: false, maxWidth: "full" }, slots: { header: [ "

slot title

", @@ -125,7 +127,9 @@ describe("DefaultWireframe", () => { }); it("should emit 'fab:clicked' after click the fab button", async () => { - const wrapper = setup(); + const wrapper = setup({ + props: { maxWidth: "nativ" }, + }); await wrapper.setProps({ fabItems: { icon: "mdi-close", @@ -138,4 +142,21 @@ describe("DefaultWireframe", () => { expect(wrapper.emitted("fab:clicked")).toHaveLength(1); }); + + describe("when 'fixedHeader' prop is set", () => { + it("should have 'fixed-header' class", async () => { + const wrapper = setup({ + props: { maxWidth: "nativ" }, + }); + + const headerBefore = wrapper.find(".wireframe-header"); + expect(headerBefore.classes("fixed")).toBe(false); + + wrapper.setProps({ fixedHeader: true }); + await nextTick(); + + const headerAfter = wrapper.find(".wireframe-header"); + expect(headerAfter.classes("fixed")).toBe(true); + }); + }); }); diff --git a/src/components/templates/DefaultWireframe.vue b/src/components/templates/DefaultWireframe.vue index acdf83e2a8..c6d32b048b 100644 --- a/src/components/templates/DefaultWireframe.vue +++ b/src/components/templates/DefaultWireframe.vue @@ -10,7 +10,7 @@ id="notify-screen-reader-assertive" class="d-sr-only" /> -
+