hookshot/tests/jira/Utils.ts
Will Hunt d772a4050c
Run Clippy in CI (#753)
* Clippy fixes

* Refactor to make rust linter happy

* Enable warnings since we have none

* Tidy up tests

* changelog
2023-05-18 11:38:59 +01:00

28 lines
1.1 KiB
TypeScript

import { expect } from "chai";
import { generateJiraWebLinkFromIssue, generateJiraWebLinkFromVersion } from "../../src/jira";
describe("Jira", () => {
describe("Utils", () => {
it("processes a jira issue into a URL", () => {
expect(generateJiraWebLinkFromIssue({
self: "https://my-test-jira/",
key: "TEST-111",
})).to.equal("https://my-test-jira/browse/TEST-111");
});
it("processes a jira issue into a URL with a port", () => {
expect(generateJiraWebLinkFromIssue({
self: "https://my-test-jira:9995/",
key: "TEST-111",
})).to.equal("https://my-test-jira:9995/browse/TEST-111");
});
it("processes a jira issue into a URL with a port", () => {
expect(generateJiraWebLinkFromVersion({
self: "https://my-test-jira:9995/",
description: "foo",
name: "bar",
projectId: "TEST-111",
id: "v1.0.0",
})).to.equal("https://my-test-jira:9995/projects/TEST-111/versions/v1.0.0");
});
});
});