2022-04-20 22:49:12 +08:00
|
|
|
/*
|
2024-09-09 21:57:16 +08:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2022-04-20 22:49:12 +08:00
|
|
|
Copyright 2022 Emmanuel Ezeka <eec.studies@gmail.com>
|
|
|
|
|
2024-09-09 21:57:16 +08:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
|
|
|
|
Please see LICENSE files in the repository root for full details.
|
2022-04-20 22:49:12 +08:00
|
|
|
*/
|
|
|
|
|
2024-10-15 21:57:26 +08:00
|
|
|
import { textToHtmlRainbow } from "../../../src/utils/colour";
|
2022-04-20 22:49:12 +08:00
|
|
|
|
|
|
|
describe("textToHtmlRainbow", () => {
|
2022-12-12 19:24:14 +08:00
|
|
|
it("correctly transform text to html without splitting the emoji in two", () => {
|
2024-03-20 07:34:11 +08:00
|
|
|
expect(textToHtmlRainbow("🐻")).toBe('<span data-mx-color="#ff00be">🐻</span>');
|
|
|
|
expect(textToHtmlRainbow("🐕🦺")).toBe('<span data-mx-color="#ff00be">🐕🦺</span>');
|
2022-04-20 22:49:12 +08:00
|
|
|
});
|
|
|
|
});
|