import { describe, it, expect } from "vitest"
import { Text } from "./text"
import { Quote } from "./quote"
describe("Quote", () => {
it("returns empty string if no params", () => {
expect(new Quote().render).toBe("")
})
it("returns attributes and data attributes", () => {
expect(new Quote({ id: "1", "data-foo": "bar" }).render).toBe(``)
})
it("returns attributes and data attributes with custom data attributes", () => {
expect(new Quote({ id: "1", data: { foo: "bar" } }).render).toBe(``)
expect(new Quote({ id: "1", data: { foo: "bar", baz: "qux" } }).render).toBe(``)
expect(new Quote({ id: "1", data: { foo: { baz: "qux", quux: "corge" } } }).render).toBe(``)
})
it("adds children", () => {
const text = new Text("Hello")
const quote = new Quote()
quote.add(text)
expect(quote.render).toBe(`Hello
`)
})
})