diff --git a/packages/vue-layout/src/layouts/__test__/snapshot/SidebarHeaderLayout.test.ts b/packages/vue-layout/src/layouts/__test__/snapshot/SidebarHeaderLayout.test.ts new file mode 100644 index 000000000..c5cc66cda --- /dev/null +++ b/packages/vue-layout/src/layouts/__test__/snapshot/SidebarHeaderLayout.test.ts @@ -0,0 +1,32 @@ +import { shallowMount } from "@vue/test-utils"; +import { describe, expect, it } from "vitest"; + +import SidebarHeaderLayout from "../../SidebarHeaderLayout.vue"; + +import type { VueWrapper } from "@vue/test-utils"; + +describe("SidebarHeaderLayout", () => { + it("matches snapshot", () => { + const wrapper: VueWrapper = shallowMount(SidebarHeaderLayout, { + props: { + menu: [ + { + name: "Menu1", + routeName: "menu-1", + shortName: "M1", + }, + { + name: "Menu2", + routeName: "menu-2", + shortName: "M2", + }, + ], + }, + slots: { + default: "
", + }, + }); + + expect(wrapper.element).toMatchSnapshot(); + }); +}); diff --git a/packages/vue-layout/src/layouts/__test__/snapshot/__snapshots__/SidebarHeaderLayout.test.ts.snap b/packages/vue-layout/src/layouts/__test__/snapshot/__snapshots__/SidebarHeaderLayout.test.ts.snap new file mode 100644 index 000000000..d9c6f84b3 --- /dev/null +++ b/packages/vue-layout/src/layouts/__test__/snapshot/__snapshots__/SidebarHeaderLayout.test.ts.snap @@ -0,0 +1,26 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`SidebarHeaderLayout > matches snapshot 1`] = ` + +`; diff --git a/packages/vue-user/src/layouts/__test__/snapshot/SidebarHeaderLayout.test.ts b/packages/vue-user/src/layouts/__test__/snapshot/SidebarHeaderLayout.test.ts new file mode 100644 index 000000000..cd1a76978 --- /dev/null +++ b/packages/vue-user/src/layouts/__test__/snapshot/SidebarHeaderLayout.test.ts @@ -0,0 +1,52 @@ +import configPlugin from "@dzangolab/vue3-config"; +import { mount } from "@vue/test-utils"; +import { createPinia } from "pinia"; +import { describe, expect, it } from "vitest"; +import { createRouter, createWebHistory } from "vue-router"; + +import SidebarHeaderLayout from "../../SidebarHeaderLayout.vue"; +import appConfig from "../config"; + +import type { VueWrapper } from "@vue/test-utils"; + +describe("SidebarHeaderLayout", () => { + it("matches snapshot", () => { + const pinia = createPinia(); + const router = createRouter({ + history: createWebHistory(), + routes: [ + { + path: "/", + name: "home", + component: SidebarHeaderLayout, + }, + ], + }); + + const wrapper: VueWrapper = mount(SidebarHeaderLayout, { + global: { + plugins: [ + pinia, + [ + configPlugin, + { + config: appConfig, + }, + ], + router, + ], + stubs: { + UserMenu: true, + LocaleSwitcher: true, + }, + }, + slots: { + afterNavLinks: "", + afterSidebarMenu: "", + default: "", + }, + }); + + expect(wrapper.element).toMatchSnapshot(); + }); +}); diff --git a/packages/vue-user/src/layouts/__test__/snapshot/__snapshots__/SidebarHeaderLayout.test.ts.snap b/packages/vue-user/src/layouts/__test__/snapshot/__snapshots__/SidebarHeaderLayout.test.ts.snap new file mode 100644 index 000000000..9e3792748 --- /dev/null +++ b/packages/vue-user/src/layouts/__test__/snapshot/__snapshots__/SidebarHeaderLayout.test.ts.snap @@ -0,0 +1,61 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`SidebarHeaderLayout > matches snapshot 1`] = ` + +`;