.gitignore and v0.2.0

This commit is contained in:
2026-08-12 03:44:07 -06:00
parent 26851fa750
commit 8f009bb1ed
22 changed files with 1175 additions and 25 deletions
+23
View File
@@ -1,5 +1,6 @@
import { fireEvent, render } from "@testing-library/vue";
import { describe, expect, it } from "vitest";
import { h } from "vue";
import DsTabs from "../src/components/navigation/DsTabs.vue";
describe("DsTabs", () => {
@@ -29,4 +30,26 @@ describe("DsTabs", () => {
});
expect(view.emitted()["update:modelValue"]?.at(-1)).toEqual(["billing"]);
});
it("keeps tab and panel relationships unique across instances", () => {
const props = {
label: "Cuenta",
modelValue: "profile",
items: [{ id: "profile", label: "Perfil" }],
};
const view = render({
setup: () => () =>
h("div", [
h(DsTabs, props, { profile: () => "Perfil" }),
h(DsTabs, props, { profile: () => "Perfil" }),
]),
});
const [firstTab, secondTab] = view.getAllByRole("tab");
const [firstPanel, secondPanel] = view.getAllByRole("tabpanel");
expect(firstTab?.id).not.toBe(secondTab?.id);
expect(firstPanel?.id).not.toBe(secondPanel?.id);
expect(firstTab?.getAttribute("aria-controls")).toBe(firstPanel?.id);
expect(firstPanel?.getAttribute("aria-labelledby")).toBe(firstTab?.id);
});
});