refactor: named arguments for render error function (#4537)

* refactor: named arguments for render error function

* Update tests/api.test.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Ophelia Goldstein
2025-10-07 23:21:18 +03:00
committed by GitHub
co-authored by Copilot Alexandr
parent f7920901b6
commit e9d0e8fd17
12 changed files with 222 additions and 125 deletions
+5 -5
View File
@@ -46,7 +46,7 @@ describe("Test utils.js", () => {
});
it("should test renderError", () => {
document.body.innerHTML = renderError("Something went wrong");
document.body.innerHTML = renderError({ message: "Something went wrong" });
expect(
queryByTestId(document.body, "message").children[0],
).toHaveTextContent(/Something went wrong/gim);
@@ -55,10 +55,10 @@ describe("Test utils.js", () => {
).toBeEmptyDOMElement(2);
// Secondary message
document.body.innerHTML = renderError(
"Something went wrong",
"Secondary Message",
);
document.body.innerHTML = renderError({
message: "Something went wrong",
secondaryMessage: "Secondary Message",
});
expect(
queryByTestId(document.body, "message").children[1],
).toHaveTextContent(/Secondary Message/gim);