Sha256: d2c35cc9a2cb2fba22f72194a16dc28aaf98fce3f1bd56d2d6a6796d0e9dd3e5

Contents?: true

Size: 1.06 KB

Versions: 9

Compression:

Stored size: 1.06 KB

Contents

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().renderWrapper).toBe("<q ></q>")
  })

  it("returns attributes and data attributes", () => {
    expect(new Quote({ id: "1", "data-foo": "bar" }).renderWrapper).toBe(`<q id='1' data-foo='bar'></q>`)
  })

  it("returns attributes and data attributes with custom data attributes", () => {
    expect(new Quote({ id: "1", data: { foo: "bar" } }).renderWrapper).toBe(`<q id='1' data-foo='bar'></q>`)
    expect(new Quote({ id: "1", data: { foo: "bar", baz: "qux" } }).renderWrapper).toBe(`<q id='1' data-foo='bar' data-baz='qux'></q>`)
    expect(new Quote({ id: "1", data: { foo: { baz: "qux", quux: "corge" } } }).renderWrapper).toBe(`<q id='1' data-foo-baz='qux' data-foo-quux='corge'></q>`)
  })

  it("adds children", () => {
    const text = new Text("Hello")
    const quote = new Quote()
    quote.add(text)
    expect(quote.renderWrapper).toBe(`<q >Hello</q>`)
  })
})

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/src/components/quote.spec.ts
clapton-0.0.25 lib/clapton/javascripts/src/components/quote.spec.ts
clapton-0.0.24 lib/clapton/javascripts/src/components/quote.spec.ts
clapton-0.0.23 lib/clapton/javascripts/src/components/quote.spec.ts
clapton-0.0.22 lib/clapton/javascripts/src/components/quote.spec.ts
clapton-0.0.21 lib/clapton/javascripts/src/components/quote.spec.ts
clapton-0.0.20 lib/clapton/javascripts/src/components/quote.spec.ts
clapton-0.0.19 lib/clapton/javascripts/src/components/quote.spec.ts
clapton-0.0.18 lib/clapton/javascripts/src/components/quote.spec.ts