Skip to content

Commit

Permalink
Fix build errors
Browse files Browse the repository at this point in the history
Add placeholder jest test
  • Loading branch information
KilianBoute committed Jun 12, 2024
1 parent 8cdc857 commit 3c64518
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 23 deletions.
14 changes: 0 additions & 14 deletions ui/__tests__/Login.test.js

This file was deleted.

23 changes: 23 additions & 0 deletions ui/__tests__/SignOut.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SignOutButton.test.js (or .test.tsx if using TypeScript)
import { render, screen } from "@testing-library/react";
import "@testing-library/jest-dom";
import SignOutButton from "../src/components/SignOutButton";
import { signOut } from "next-auth/react";

// Mock next-auth/react's signOut function
jest.mock("next-auth/react", () => ({
signOut: jest.fn(),
}));

describe("SignOutButton", () => {
it('renders "Sign out" button', () => {
// Render the SignOutButton component
render(<SignOutButton />);

// Get the button element
const buttonElement = screen.getByRole("button", { name: /Sign out/i });

// Check if the button is in the document
expect(buttonElement).toBeInTheDocument();
});
});
5 changes: 3 additions & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@reduxjs/toolkit": "^2.2.5",
"@uug-ai/ui": "1.0.34",
"@uug-ai/ui": "1.0.35",
"autoprefixer": "^10.4.19",
"cookies-next": "^4.2.1",
"next": "14",
Expand All @@ -34,7 +34,8 @@
"@playwright/test": "^1.43.1",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^15.0.4",
"@types/node": "^20",
"@types/jest": "^29.5.12",
"@types/node": "^20.14.2",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
Expand Down
1 change: 1 addition & 0 deletions ui/src/middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "next-auth/middleware";
1 change: 1 addition & 0 deletions ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"types": ["jest", "node"],
"plugins": [
{
"name": "next"
Expand Down
29 changes: 22 additions & 7 deletions ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2634,6 +2634,14 @@
dependencies:
"@types/istanbul-lib-report" "*"

"@types/jest@^29.5.12":
version "29.5.12"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.12.tgz#7f7dc6eb4cf246d2474ed78744b05d06ce025544"
integrity sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==
dependencies:
expect "^29.0.0"
pretty-format "^29.0.0"

"@types/jsdom@^20.0.0":
version "20.0.1"
resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-20.0.1.tgz#07c14bc19bd2f918c1929541cdaacae894744808"
Expand Down Expand Up @@ -2668,7 +2676,7 @@
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690"
integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==

"@types/node@*", "@types/node@^20":
"@types/node@*":
version "20.12.12"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.12.tgz#7cbecdf902085cec634fdb362172dfe12b8f2050"
integrity sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==
Expand All @@ -2682,6 +2690,13 @@
dependencies:
undici-types "~5.26.4"

"@types/node@^20.14.2":
version "20.14.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.2.tgz#a5f4d2bcb4b6a87bffcaa717718c5a0f208f4a18"
integrity sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==
dependencies:
undici-types "~5.26.4"

"@types/normalize-package-data@^2.4.0":
version "2.4.4"
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901"
Expand Down Expand Up @@ -2880,10 +2895,10 @@
resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406"
integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==

"@uug-ai/[email protected].34":
version "1.0.34"
resolved "https://registry.yarnpkg.com/@uug-ai/ui/-/ui-1.0.34.tgz#473b67825631993154f667fa00ac9842c26dae1a"
integrity sha512-TojkW5o3QlrctQBnC1B+C16kexfoCbypW4jHFjHW6IrooS/qH/poWnkAAGzj/U2hqGC1LL/Y4nvz2kyagjn5oQ==
"@uug-ai/[email protected].35":
version "1.0.35"
resolved "https://registry.yarnpkg.com/@uug-ai/ui/-/ui-1.0.35.tgz#3daab5491ac3d3a2d33d9b47af1f3d07b9aec2e8"
integrity sha512-/ZNHGNt1NWsYk1XTKmUlLSsSqelWXuo3UiIOCxwE2DNeTTfvboB8/OpXOCgKYpTKtoay5Zs85g+WyE6rrLFkbg==
dependencies:
"@storybook/addon-essentials" "^8.0.9"
"@storybook/addon-interactions" "^8.0.9"
Expand Down Expand Up @@ -4835,7 +4850,7 @@ exit@^0.1.2:
resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==

expect@^29.7.0:
expect@^29.0.0, expect@^29.7.0:
version "29.7.0"
resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc"
integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==
Expand Down Expand Up @@ -7519,7 +7534,7 @@ pretty-format@^27.0.2:
ansi-styles "^5.0.0"
react-is "^17.0.1"

pretty-format@^29.7.0:
pretty-format@^29.0.0, pretty-format@^29.7.0:
version "29.7.0"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812"
integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==
Expand Down

0 comments on commit 3c64518

Please sign in to comment.