Files
github-stats-extended/apps/backend/tests/render.test.js
T
Marco Pasqualettiandmartin-mfg 8c065b473f feat: setup monorepo using pnpm (#20)
* tests: fix float problems and PAT problem

* extend CONTRIBUTING.md

* extend build documentation, add GH action, fix build on MacOS

* fix build on Vercel

* update .gitignore and CONTRIBUTING.md

* feat: begin work on monorepo

* chore(actions/basic-build): use pnpm

* fix: vercel-deploy

* docs: updates with new folders

* chore: apply PR review comments

---------

Co-authored-by: martin-mfg <2026226+martin-mfg@users.noreply.github.com>
2026-01-19 14:11:58 +01:00

28 lines
900 B
JavaScript

// @ts-check
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";
describe("Test render.js", () => {
it("should test renderError", () => {
document.body.innerHTML = renderError({ message: "Something went wrong" });
expect(
queryByTestId(document.body, "message")?.children[0],
).toHaveTextContent(/Something went wrong/gim);
expect(
queryByTestId(document.body, "message")?.children[1],
).toBeEmptyDOMElement();
// Secondary message
document.body.innerHTML = renderError({
message: "Something went wrong",
secondaryMessage: "Secondary Message",
});
expect(
queryByTestId(document.body, "message")?.children[1],
).toHaveTextContent(/Secondary Message/gim);
});
});