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