forked from mirrored/github-readme-stats
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:
co-authored by
Copilot
Alexandr
parent
f7920901b6
commit
e9d0e8fd17
+5
-5
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user