Sha256: e2f7a87c4917be294db83e570d9f1131f1a56af27338492401edbf95c8cfb7b4
Contents?: true
Size: 936 Bytes
Versions: 9
Compression:
Stored size: 936 Bytes
Contents
import { describe, it, expect } from "vitest" import { Button } from "./button" describe("Button", () => { it("returns empty string if no params", () => { expect(new Button().renderWrapper).toBe("<button ></button>") }) it("returns attributes and data attributes", () => { expect(new Button({ id: "1", "data-foo": "bar" }).renderWrapper).toBe(`<button id='1' data-foo='bar'></button>`) }) it("returns attributes and data attributes with custom data attributes", () => { expect(new Button({ id: "1", data: { foo: "bar" } }).renderWrapper).toBe(`<button id='1' data-foo='bar'></button>`) expect(new Button({ id: "1", data: { foo: "bar", baz: "qux" } }).renderWrapper).toBe(`<button id='1' data-foo='bar' data-baz='qux'></button>`) expect(new Button({ id: "1", data: { foo: { baz: "qux", quux: "corge" } } }).renderWrapper).toBe(`<button id='1' data-foo-baz='qux' data-foo-quux='corge'></button>`) }) })
Version data entries
9 entries across 9 versions & 1 rubygems