import { getBookBadgeInfoFromBookData } from "../BookRibbonBadge"

const book = require("./bluekiss.book.json").data.book

describe("BookRibbon test", () => {
  it("Should calculate badge correctly", () => {
    const badges = getBookBadgeInfoFromBookData(book)

    expect(badges).toContainEqual({
      name: "jelly",
      label: "20.4m"
    })
    expect(badges).toContainEqual({
      name: "view",
      label: "107.6k"
    })
    expect(badges).toContainEqual({
      name: "miniheart",
      label: "10"
    })
    expect(badges).toContainEqual({
      name: "rating",
      label: "4.82"
    })
  })
})
