hookshot/tests/FormatUtilTest.ts

26 lines
815 B
TypeScript
Raw Normal View History

2020-02-21 16:58:02 +00:00
import { FormatUtil } from "../src/FormatUtil";
import { expect } from "chai";
const SIMPLE_ISSUE = {
number: 123,
state: "open",
title: "A simple title",
full_name: "evilcorp/lab",
url: "https://github.com/evilcorp/lab/issues/123",
2020-02-21 16:58:02 +00:00
html_url: "https://github.com/evilcorp/lab/issues/123",
repository_url: "https://api.github.com/repos/evilcorp/lab",
};
describe("FormatUtilTest", () => {
it("correctly formats a room name", () => {
expect(FormatUtil.formatRepoRoomName(SIMPLE_ISSUE)).to.equal(
2020-02-21 16:58:02 +00:00
"evilcorp/lab#123: A simple title",
);
});
it("correctly formats a room topic", () => {
expect(FormatUtil.formatRoomTopic(SIMPLE_ISSUE)).to.equal(
2020-02-26 13:50:38 +00:00
"Status: open | https://github.com/evilcorp/lab/issues/123",
2020-02-21 16:58:02 +00:00
);
});
});