First commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user