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",
|
2020-11-22 21:10:27 +00:00
|
|
|
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", () => {
|
2020-11-22 21:10:27 +00:00
|
|
|
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
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|