forked from mirrored/github-readme-stats
refactor: move encode HTML function tests into separate module (#4593)
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
This commit is contained in:
co-authored by
Alexandr
parent
a72d88fd54
commit
f5de29fa67
@@ -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(`<html>hello world<,.#4^&^@%!))`)).toBe(
|
||||
"<html>hello world<,.#4^&^@%!))",
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -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(`<html>hello world<,.#4^&^@%!))`)).toBe(
|
||||
"<html>hello world<,.#4^&^@%!))",
|
||||
);
|
||||
});
|
||||
|
||||
it("should test renderError", () => {
|
||||
document.body.innerHTML = renderError({ message: "Something went wrong" });
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user