diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ee045bd..04037654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Lines marked **Upgrade step** need you to act after updating. ### Fixed +- The top bar has the same height on the dashboard and in the form editor, so it no longer jumps between them. (#300) - Clicking "Log in" on the two-factor code screen now sends the code. Before, only Enter worked. (#299) - No more PHP 8.5 deprecation warning for the MySQL SSL option on container start. (#298) diff --git a/resources/js/Layouts/AppLayout.test.ts b/resources/js/Layouts/AppLayout.test.ts index f6b89efe..5ff9e263 100644 --- a/resources/js/Layouts/AppLayout.test.ts +++ b/resources/js/Layouts/AppLayout.test.ts @@ -93,4 +93,33 @@ describe("app header", () => { // on phones it's in the form menu: the name keeps its room expect(preview.classes()).toEqual(expect.arrayContaining(["hidden", "lg:flex"])); }); + + it("gives the dashboard bar and a form's bar one height", async () => { + window.route = ((name: string) => `/${name}`) as typeof window.route; + // the store is shared, so check the dashboard bar before a form is set + const dashboard = mountLayout(); + useForm().$patch({ form: null }); + await dashboard.vm.$nextTick(); + expect(dashboard.get("nav.bg-grey-800 > div > div").classes()).toContain("h-bar"); + + const wrapper = mount(AppLayout, { + props: { title: "Form Settings" }, + global: { + mocks: { $page, route: () => "/" }, + stubs: { + Head: true, + Link: true, + JetBanner: true, + FormMenu: true, + FormPageTabs: true, + PublishControl: true, + AccountMenu: true, + }, + }, + }); + useForm().$patch({ form: { uuid: "form1", is_published: false } as FormModel }); + await wrapper.vm.$nextTick(); + + expect(wrapper.get("header").classes()).toContain("h-bar"); + }); }); diff --git a/resources/js/Layouts/AppLayout.vue b/resources/js/Layouts/AppLayout.vue index fee23233..bd60482e 100644 --- a/resources/js/Layouts/AppLayout.vue +++ b/resources/js/Layouts/AppLayout.vue @@ -14,12 +14,12 @@