From c8b3305ed7202cdadcc783f157ddfddd40d28f74 Mon Sep 17 00:00:00 2001 From: Alexandr Date: Fri, 17 Oct 2025 22:38:00 +0300 Subject: [PATCH] refactor: move encode HTML function tests into separate module --- tests/html.test.js | 10 ++++++++++ tests/render.test.js | 7 ------- 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 tests/html.test.js diff --git a/tests/html.test.js b/tests/html.test.js new file mode 100644 index 0000000000000..d83143adc924c --- /dev/null +++ b/tests/html.test.js @@ -0,0 +1,10 @@ +import { describe, expect, it } from "@jest/globals"; +import { encodeHTML } from "../src/common/html.js"; + +describe("Test html.js", () => { + it("should test encodeHTML", () => { + expect(encodeHTML(`hello world<,.#4^&^@%!))`)).toBe( + "<html>hello world<,.#4^&^@%!))", + ); + }); +}); diff --git a/tests/render.test.js b/tests/render.test.js index 935b7335a9288..6bb409b1c47e5 100644 --- a/tests/render.test.js +++ b/tests/render.test.js @@ -4,15 +4,8 @@ import { describe, expect, it } from "@jest/globals"; import { queryByTestId } from "@testing-library/dom"; import "@testing-library/jest-dom/jest-globals"; import { renderError } from "../src/common/render.js"; -import { encodeHTML } from "../src/common/html.js"; describe("Test render.js", () => { - it("should test encodeHTML", () => { - expect(encodeHTML(`hello world<,.#4^&^@%!))`)).toBe( - "<html>hello world<,.#4^&^@%!))", - ); - }); - it("should test renderError", () => { document.body.innerHTML = renderError({ message: "Something went wrong" }); expect(