workadventure/front/tests/Phaser/Game/HtmlUtilsTest.ts

14 lines
545 B
TypeScript
Raw Normal View History

import "jasmine";
import {HtmlUtils} from "../../../src/WebRtc/HtmlUtils";
describe("urlify()", () => {
it("should transform an url into a link", () => {
const text = HtmlUtils.urlify('https://google.com');
2021-02-11 14:49:32 +01:00
expect(text.innerHTML).toEqual('<a href="https://google.com" target="_blank" style=":visited {color: white}">https://google.com</a>');
});
it("should not transform a normal text into a link", () => {
const text = HtmlUtils.urlify('hello');
2021-02-11 14:49:32 +01:00
expect(text.innerHTML).toEqual('hello');
});
});