18 lines
605 B
TypeScript
18 lines
605 B
TypeScript
import { render } from "@testing-library/vue";
|
|
import { describe, expect, it } from "vitest";
|
|
import DsButton from "../src/components/actions/DsButton.vue";
|
|
|
|
describe("DsButton", () => {
|
|
it("preserves its accessible name while loading and prevents duplicate actions", async () => {
|
|
const view = render(DsButton, {
|
|
props: { loading: true },
|
|
slots: { default: "Guardar" },
|
|
});
|
|
const button = view.getByRole("button", {
|
|
name: /guardar/i,
|
|
}) as HTMLButtonElement;
|
|
expect(button.disabled).toBe(true);
|
|
expect(button.getAttribute("aria-busy")).toBe("true");
|
|
});
|
|
});
|