Project import from github
All checks were successful
Production Build and Deploy / Build (push) Successful in 1m7s
Production Build and Deploy / Deploy (push) Successful in 21s

This commit is contained in:
Liviu Burcusel 2026-01-14 16:29:05 +01:00
commit 0add58254d
Signed by: liviu
GPG key ID: 6CDB37A4AD2C610C
179 changed files with 23756 additions and 0 deletions

View file

@ -0,0 +1,40 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createPinia, setActivePinia } from "pinia";
import { useBreadcrumbStore } from "~/stores/breadcrumbs";
vi.unmock("~/stores/breadcrumbs");
describe("useBreadcrumbStore", () => {
beforeEach(() => {
setActivePinia(createPinia());
});
describe("init", () => {
it("should initialize", () => {
const store = useBreadcrumbStore();
expect(store.items.length).toEqual(0);
});
it("clear should remove all breadcrumbs", () => {
const store = useBreadcrumbStore();
store.addBreadcrumb({ label: "Test", to: "/test" });
store.clear();
expect(store.items.length).toEqual(0);
});
it("addBreadcrumb should add a breadcrumb", () => {
const store = useBreadcrumbStore();
store.addBreadcrumb({ label: "Test", to: "/test" });
expect(store.items.length).toEqual(1);
});
it("setBreadcrumbs should set breadcrumbs", () => {
const store = useBreadcrumbStore();
store.setBreadcrumbs([
{ label: "Test", to: "/test" },
{ label: "Test 2", to: "/test2" },
]);
expect(store.items.length).toEqual(2);
});
});
});