2018-10-18 14:40:35 +02:00
|
|
|
// @flow
|
|
|
|
|
|
2018-10-19 08:44:03 +02:00
|
|
|
import {parseDescription} from "./changesets";
|
2018-10-18 14:40:35 +02:00
|
|
|
|
|
|
|
|
describe("parseDescription tests", () => {
|
|
|
|
|
it("should return a description with title and message", () => {
|
|
|
|
|
const desc = parseDescription("Hello\nTrillian");
|
|
|
|
|
expect(desc.title).toBe("Hello");
|
|
|
|
|
expect(desc.message).toBe("Trillian");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("should return a description with title and without message", () => {
|
|
|
|
|
const desc = parseDescription("Hello Trillian");
|
|
|
|
|
expect(desc.title).toBe("Hello Trillian");
|
|
|
|
|
});
|
2018-10-24 10:25:50 +02:00
|
|
|
|
|
|
|
|
it("should return an empty description for undefined", () => {
|
|
|
|
|
const desc = parseDescription();
|
|
|
|
|
expect(desc.title).toBe("");
|
|
|
|
|
expect(desc.message).toBe("");
|
|
|
|
|
});
|
2018-10-18 14:40:35 +02:00
|
|
|
});
|