Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

831 B
Raw Blame
import { describe, expect, it } from "vite-plus/test";
import { makeUi } from "../render/ui.js";
import { renderNotificationsRead } from "./render-notifications-read.js";

const ui = makeUi({
  color: 0,
  unicode: true,
  hyperlinks: false,
  animate: false,
  columns: 80,
});

describe("renderNotificationsRead", () => {
  it("counts the notifications it marked", () => {
    expect(renderNotificationsRead(ui, { all: false, count: 1 })).toEqual([
      "",
      "  ✓ Marked 1 notification read",
      "",
    ]);
    expect(renderNotificationsRead(ui, { all: false, count: 3 })[1]).toBe(
      "  ✓ Marked 3 notifications read",
    );
  });

  it("covers marking everything", () => {
    expect(renderNotificationsRead(ui, { all: true, count: 0 })[1]).toBe(
      "  ✓ Marked all notifications read",
    );
  });
});