Sha256: 9222e592a855cba2a4f904e4df95cc9e60732413ea7bc12de6fccabd59400ca5
Contents?: true
Size: 847 Bytes
Versions: 7
Compression:
Stored size: 847 Bytes
Contents
import { describe, it, expect } from "vitest" import { TextField } from "./text-field" describe("TextField", () => { it("returns empty string if no params", () => { expect(new TextField({}, "foo").renderWrapper).toBe("<input type='text' data-attribute='foo' value=''/>") }) it("returns attributes and data attributes", () => { expect(new TextField({ foo: "bar" }, "foo", { id: "1", "data-foo": "bar" }).renderWrapper).toBe(`<input type='text' id='1' data-foo='bar' data-attribute='foo' value='bar'/>`) }) it("returns attributes and data attributes with custom data attributes", () => { expect(new TextField({ foo: "bar" }, "foo", { id: "1", data: { foo: { baz: "qux", quux: "corge" } } }).renderWrapper).toBe(`<input type='text' id='1' data-attribute='foo' data-foo-baz='qux' data-foo-quux='corge' value='bar'/>`) }) })
Version data entries
7 entries across 7 versions & 1 rubygems