Sha256: a02a44b3c56ee25b2a122ba4d56513e97fb5d0c1fa510bc51c4980fbeab70ba0
Contents?: true
Size: 796 Bytes
Versions: 17
Compression:
Stored size: 796 Bytes
Contents
import { describe, it, expect } from "vitest" import { TextArea } from "./text-area" describe("TextArea", () => { it("returns empty string if no params", () => { expect(new TextArea({}, "foo").render).toBe("<textarea data-attribute='foo'></textarea>") }) it("returns attributes and data attributes", () => { expect(new TextArea({ foo: "bar" }, "foo", { id: "1", "data-foo": "bar" }).render).toBe(`<textarea id='1' data-foo='bar' data-attribute='foo'>bar</textarea>`) }) it("returns attributes and data attributes with custom data attributes", () => { expect(new TextArea({ foo: "bar" }, "foo", { id: "1", data: { foo: { baz: "qux", quux: "corge" } } }).render).toBe(`<textarea id='1' data-attribute='foo' data-foo-baz='qux' data-foo-quux='corge'>bar</textarea>`) }) })
Version data entries
17 entries across 17 versions & 1 rubygems