Sha256: 1a5600a60d890f7fd24854174b83aca8f3ede4a0a97bfefa20b1cc303d7c81ce

Contents?: true

Size: 1.22 KB

Versions: 7

Compression:

Stored size: 1.22 KB

Contents

import { describe, it, expect } from "vitest"
import { BlockQuote } from "./block-quote"
import { Text } from "./text"

describe("BlockQuote", () => {
  it("returns empty string if no params", () => {
    expect(new BlockQuote().renderWrapper).toBe("<blockquote ></blockquote>")
  })

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

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

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

Version data entries

7 entries across 7 versions & 1 rubygems

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