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:
parent
0e52b133af
commit
ddc7ace78d
@ -312,7 +312,6 @@ describe("parse Handlebars helper", () => {
|
|||||||
const testCases = [{
|
const testCases = [{
|
||||||
input: "http://example.com/#hash",
|
input: "http://example.com/#hash",
|
||||||
expected:
|
expected:
|
||||||
"" +
|
|
||||||
"<a href=\"http://example.com/#hash\" target=\"_blank\" rel=\"noopener\">" +
|
"<a href=\"http://example.com/#hash\" target=\"_blank\" rel=\"noopener\">" +
|
||||||
"http://example.com/#hash" +
|
"http://example.com/#hash" +
|
||||||
"</a>",
|
"</a>",
|
||||||
@ -333,4 +332,15 @@ describe("parse Handlebars helper", () => {
|
|||||||
"Channel: <span class=\"inline-channel\" role=\"button\" tabindex=\"0\" data-chan=\"##channel\">##channel</span>"
|
"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>"
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user