2022-04-20 16:49:12 +02:00
|
|
|
/*
|
2024-09-09 15:57:16 +02:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2022-04-20 16:49:12 +02:00
|
|
|
Copyright 2022 Emmanuel Ezeka <eec.studies@gmail.com>
|
|
|
|
|
2024-09-09 15:57:16 +02: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 16:49:12 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
import { textToHtmlRainbow } from "../../src/utils/colour";
|
|
|
|
|
|
|
|
describe("textToHtmlRainbow", () => {
|
2022-12-12 12:24:14 +01:00
|
|
|
it("correctly transform text to html without splitting the emoji in two", () => {
|
2024-03-20 00:34:11 +01:00
|
|
|
expect(textToHtmlRainbow("🐻")).toBe('<span data-mx-color="#ff00be">🐻</span>');
|
|
|
|
expect(textToHtmlRainbow("🐕🦺")).toBe('<span data-mx-color="#ff00be">🐕🦺</span>');
|
2022-04-20 16:49:12 +02:00
|
|
|
});
|
|
|
|
});
|