Bring test from ircmessageparser

See https://github.com/Bonuspunkt/ircmessageparser/pull/12/files#diff-e6c9a6bca996bc454cc244d17bfeda5c for reference (same test, linted)
This commit is contained in:
Jérémie Astori 2017-11-26 14:26:59 -05:00
parent 0e52b133af
commit ddc7ace78d
No known key found for this signature in database
GPG Key ID: B9A4F245CD67BDE8

View File

@ -312,7 +312,6 @@ describe("parse Handlebars helper", () => {
const testCases = [{
input: "http://example.com/#hash",
expected:
"" +
"<a href=\"http://example.com/#hash\" target=\"_blank\" rel=\"noopener\">" +
"http://example.com/#hash" +
"</a>",
@ -333,4 +332,15 @@ describe("parse Handlebars helper", () => {
"Channel: <span class=\"inline-channel\" role=\"button\" tabindex=\"0\" data-chan=\"##channel\">##channel</span>"
);
});
it("should handle overlapping parts by using first starting", () => {
const input = "#test-https://example.com";
const actual = parse(input);
expect(actual).to.equal(
"<span class=\"inline-channel\" role=\"button\" tabindex=\"0\" data-chan=\"#test-https://example.com\">" +
"#test-https://example.com" +
"</span>"
);
});
});