diff --git a/E2E/Auth.spec.ts b/E2E/Auth.spec.ts index a7ecc43..df184e9 100644 --- a/E2E/Auth.spec.ts +++ b/E2E/Auth.spec.ts @@ -112,7 +112,7 @@ async function signUpAndTestWrongPassword(page: Page) { // Desktop authentication test.describe('Desktop authentication', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( ['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Desktop tests are not run on mobile projects' @@ -126,7 +126,7 @@ test.describe('Desktop authentication', () => { // Mobile authentication test.describe('Mobile authentication', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( !['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Mobile tests are only run on mobile projects' diff --git a/E2E/Fixtures.ts b/E2E/Fixtures.ts index 876d106..9b0f115 100644 --- a/E2E/Fixtures.ts +++ b/E2E/Fixtures.ts @@ -1,5 +1,5 @@ -import { test as base, expect } from '@playwright/test' +import { test as base, expect, type APIRequestContext } from '@playwright/test' import { BACKEND_URL } from './E2EConfig' import { addCoverageReport } from 'monocart-reporter' @@ -21,13 +21,17 @@ type Fixtures = { seedReview: (userId: number) => Promise } -// GraphQL helper -async function graphql( - request: any, +type GraphQLResponse = { + data?: TData + errors?: { message: string }[] +} + +async function graphql( + request: APIRequestContext, query: string, - variables = {}, + variables: Record = {}, token?: string -) { +): Promise { const res = await request.post(BACKEND_URL, { headers: token ? { Authorization: `Bearer ${token}` } @@ -42,24 +46,27 @@ async function graphql( ) } - const json = await res.json() + const json: GraphQLResponse = await res.json() - if (json.errors) { + if (json.errors?.length) { throw new Error(json.errors[0].message) } + if (json.data === undefined) { + throw new Error('Backend response did not include data') + } return json.data } // Create a test user -async function createUser(request: any): Promise { +async function createUser(request: APIRequestContext): Promise { const stamp = `${Date.now()}${Math.random().toString(36).slice(2, 6)}` const username = `e2e${stamp}` const email = `e2e+${stamp}@example.com` - const data = await graphql( + const data = await graphql<{ signup: TestUser }>( request, ` mutation($u: String!, $e: String!, $p: String!) { @@ -136,7 +143,7 @@ export const test = base.extend({ throw new Error(`Unknown test user ID: ${userId}`) } - const gamesData = await graphql( + const gamesData = await graphql<{ games: { appid: number }[] }>( request, ` query { @@ -186,7 +193,7 @@ export const test = base.extend({ ) } - const gamesData = await graphql( + const gamesData = await graphql<{ games: { appid: number }[] }>( request, ` query { diff --git a/E2E/Friendpage.spec.ts b/E2E/Friendpage.spec.ts index 7d191e7..8f15fea 100644 --- a/E2E/Friendpage.spec.ts +++ b/E2E/Friendpage.spec.ts @@ -78,7 +78,7 @@ async function addFriend(page: Page, friendId: string) { // Desktop tests test.describe('FriendPage', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( ['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Desktop tests are not run on mobile projects' @@ -102,7 +102,7 @@ test.describe('FriendPage', () => { // Mobile tests test.describe('Mobile FriendPage', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( !['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Mobile tests are only run on mobile projects' diff --git a/E2E/Mainpage.spec.ts b/E2E/Mainpage.spec.ts index 777c422..0ffd9b5 100644 --- a/E2E/Mainpage.spec.ts +++ b/E2E/Mainpage.spec.ts @@ -38,7 +38,7 @@ async function navigateFromRecentReviewToGame( // Desktop tests test.describe('Desktop MainPage - Carousels', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( ['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Desktop tests are not run on mobile projects' @@ -60,7 +60,7 @@ test.describe('Desktop MainPage - Carousels', () => { // Mobile tests test.describe('Mobile MainPage - Carousels', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( !['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Mobile tests are only run on mobile projects' @@ -86,7 +86,7 @@ test.describe('Mobile MainPage - Carousels', () => { // Recent review navigation - Desktop test.describe('Desktop MainPage components', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( ['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Desktop tests are not run on mobile projects' @@ -104,7 +104,7 @@ test.describe('Desktop MainPage components', () => { // Recent review navigation - Mobile test.describe('Mobile MainPage components', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( !['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Mobile tests are only run on mobile projects' diff --git a/E2E/MainpageToGamepage.spec.ts b/E2E/MainpageToGamepage.spec.ts index e0e3cea..07de9db 100644 --- a/E2E/MainpageToGamepage.spec.ts +++ b/E2E/MainpageToGamepage.spec.ts @@ -72,7 +72,7 @@ async function navigateToWishlist(page: Page, isMobile = false) { // Desktop test test.describe('Desktop top game and wishlist', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( ['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Desktop tests are not run on mobile projects' @@ -93,7 +93,7 @@ test.describe('Desktop top game and wishlist', () => { // Mobile test test.describe('Mobile top game and wishlist', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( !['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Mobile tests are only run on mobile projects' diff --git a/E2E/Navigation.spec.ts b/E2E/Navigation.spec.ts index 44d73f2..d97717b 100644 --- a/E2E/Navigation.spec.ts +++ b/E2E/Navigation.spec.ts @@ -42,14 +42,14 @@ async function navigateMobile( // Desktop header navigation test.describe('Desktop header navigation', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( ['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Desktop tests are not run on mobile projects' ) }) - test('Navigate through all header pages and sign out', async ({ page, user }) => { + test('Navigate through all header pages and sign out', async ({ page, user: _user }) => { await openMainPage(page) // MainPage -> SearchPage @@ -111,7 +111,7 @@ test.describe('Desktop header navigation', () => { // Mobile header navigation test.describe('Mobile header navigation', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( !['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Mobile tests are only run on mobile projects' @@ -122,7 +122,7 @@ test.describe('Mobile header navigation', () => { viewport: { width: 390, height: 844 } }) - test('Navigate through all header pages and sign out', async ({ page, user }) => { + test('Navigate through all header pages and sign out', async ({ page, user: _user }) => { await openMainPage(page) // MainPage -> SearchPage diff --git a/E2E/Profilepage.spec.ts b/E2E/Profilepage.spec.ts index 8a8de48..5be6f90 100644 --- a/E2E/Profilepage.spec.ts +++ b/E2E/Profilepage.spec.ts @@ -38,21 +38,21 @@ async function editUserProfile(page: Page) { // Desktop profile tests test.describe('Desktop ProfilePage', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( ['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Desktop tests are not run on mobile projects' ) }) - test('User can edit their profile', async ({ page, user }) => { + test('User can edit their profile', async ({ page, user: _user }) => { await editUserProfile(page) }) }) // Mobile profile tests test.describe('Mobile ProfilePage', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( !['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Mobile tests are only run on mobile projects' @@ -63,7 +63,7 @@ test.describe('Mobile ProfilePage', () => { viewport: { width: 390, height: 844 } }) - test('User can edit their profile on mobile', async ({ page, user }) => { + test('User can edit their profile on mobile', async ({ page, user: _user }) => { await editUserProfile(page) }) }) diff --git a/E2E/Reviews.spec.ts b/E2E/Reviews.spec.ts index 9e04dcd..c1e14b5 100644 --- a/E2E/Reviews.spec.ts +++ b/E2E/Reviews.spec.ts @@ -32,7 +32,7 @@ async function navigateFromRecentReviewToGame( // Desktop tests test.describe('Desktop Recent Reviews', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( ['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Desktop tests are not run on mobile projects' @@ -50,7 +50,7 @@ async function navigateFromRecentReviewToGame( // Mobile tests test.describe('Mobile Recent Reviews', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( !['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Mobile tests are only run on mobile projects' diff --git a/E2E/Searchpage.spec.ts b/E2E/Searchpage.spec.ts index 9f40717..9eee6c7 100644 --- a/E2E/Searchpage.spec.ts +++ b/E2E/Searchpage.spec.ts @@ -149,7 +149,7 @@ async function checkSearchPagination(page: Page, checkReturnToFirstPage = true) // Desktop SearchPage tests test.describe('Desktop SearchPage', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( ['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Desktop tests are not run on mobile projects' @@ -195,7 +195,7 @@ test.describe('Mobile SearchPage', () => { viewport: { width: 390, height: 844 } }) - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( !['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Mobile tests are only run on mobile projects' diff --git a/E2E/Wishlist.spec.ts b/E2E/Wishlist.spec.ts index 841ef76..7d3c0c7 100644 --- a/E2E/Wishlist.spec.ts +++ b/E2E/Wishlist.spec.ts @@ -107,7 +107,7 @@ async function checkWishlistHorizontalOverflow(page: Page) { // Desktop WishlistPage tests test.describe('Desktop WishlistPage', () => { - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( ['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Desktop tests are not run on mobile projects' @@ -137,7 +137,7 @@ test.describe('Mobile WishlistPage', () => { viewport: { width: 390, height: 844 } }) - test.beforeEach(async ({}, testInfo) => { + test.beforeEach(async ({ page: _page }, testInfo) => { test.skip( !['mobile-chrome', 'Mobile Safari'].includes(testInfo.project.name), 'Mobile tests are only run on mobile projects' diff --git a/Frontend/src/components/Header.tsx b/Frontend/src/components/Header.tsx index cb04c99..eba5666 100644 --- a/Frontend/src/components/Header.tsx +++ b/Frontend/src/components/Header.tsx @@ -18,13 +18,9 @@ import { UseAuth } from '../context/AuthContext' export default function Header() { const { user, logout } = UseAuth() - const [menuOpen, setMenuOpen] = useState(false) - const location = useLocation() - - useEffect(() => { - setMenuOpen(false) - }, [location.pathname]) + const [menuOpenPath, setMenuOpenPath] = useState(null) + const menuOpen = menuOpenPath === location.pathname const navigationLinks = [ { to: '/', label: 'Home', icon: }, @@ -35,14 +31,14 @@ export default function Header() { ] const CloseMenu = () => { - setMenuOpen(false) + setMenuOpenPath(null) } // Close the menu with Escape useEffect(() => { if (!menuOpen) return undefined const HandleKeyDown = (e: KeyboardEvent) => { - if (e.key === 'Escape') setMenuOpen(false) + if (e.key === 'Escape') setMenuOpenPath(null) } window.addEventListener('keydown', HandleKeyDown) return () => window.removeEventListener('keydown', HandleKeyDown) @@ -57,7 +53,11 @@ export default function Header() { aria-label={menuOpen ? 'Close menu' : 'Open menu'} aria-expanded={menuOpen} aria-controls="navigationMenue" - onClick={() => setMenuOpen((open) => !open)} + onClick={() => + setMenuOpenPath((path) => + path === location.pathname ? null : location.pathname + ) + } > {menuOpen ? : } @@ -83,9 +83,7 @@ export default function Header() { key={link.to} to={link.to} end - className={({ isActive }) => - isActive ? 'is-active' : undefined - } + className={({ isActive }) => (isActive ? 'is-active' : undefined)} > {link.icon} {link.label} @@ -93,10 +91,7 @@ export default function Header() { ))} {user ? ( - + Sign Out @@ -104,9 +99,7 @@ export default function Header() { - isActive ? 'is-active' : undefined - } + className={({ isActive }) => (isActive ? 'is-active' : undefined)} > Sign In diff --git a/Frontend/src/components/ReviewCard.tsx b/Frontend/src/components/ReviewCard.tsx index c05d92c..62f20b1 100644 --- a/Frontend/src/components/ReviewCard.tsx +++ b/Frontend/src/components/ReviewCard.tsx @@ -118,7 +118,7 @@ export default function ReviewCard({ className="app-button" size="small" onClick={() => onEdit(review)} - aria-label={`Edit review for ${game?.name} `} + aria-label={game ? `Edit review for ${game.name}` : 'Edit review'} > Edit @@ -126,7 +126,7 @@ export default function ReviewCard({ className="reviewCardDelete" size="small" onClick={() => onDelete(review)} - aria-label={`Delete review for ${game?.name} `} + aria-label={game ? `Delete review for ${game.name}` : 'Delete review'} > Delete diff --git a/Frontend/src/pages/GamePage.tsx b/Frontend/src/pages/GamePage.tsx index e53517a..8a1fa81 100644 --- a/Frontend/src/pages/GamePage.tsx +++ b/Frontend/src/pages/GamePage.tsx @@ -18,7 +18,7 @@ export default function GamePage() { } | null>(null) const isValidAppId = Number.isSafeInteger(appid) && appid > 0 - + useEffect(() => { if (!isValidAppId) return @@ -41,7 +41,7 @@ export default function GamePage() { return () => { cancelled = true } - }, [appid]) + }, [appid, isValidAppId]) const isLoading = isValidAppId && loadedGame?.appid !== appid const game = loadedGame?.appid === appid ? loadedGame.game : null diff --git a/Frontend/src/tests/GamePage.test.tsx b/Frontend/src/tests/GamePage.test.tsx index cecf9fc..77cd025 100644 --- a/Frontend/src/tests/GamePage.test.tsx +++ b/Frontend/src/tests/GamePage.test.tsx @@ -80,11 +80,11 @@ describe('GamePage', () => { }) it('does not fetch when the route id is invalid', () => { - RenderGamePage('/game/not-a-number') + RenderGamePage('/game/not-a-number') - expect(screen.getByText(/We couldn't find that game/)).toBeTruthy() + expect(screen.getByText(/We couldn't find that game/)).toBeTruthy() - expect(GetGameById).not.toHaveBeenCalled() - expect(FetchGamesFromDB).not.toHaveBeenCalled() + expect(GetGameById).not.toHaveBeenCalled() + expect(FetchGamesFromDB).not.toHaveBeenCalled() }) }) diff --git a/Frontend/src/tests/MainPage.test.tsx b/Frontend/src/tests/MainPage.test.tsx index 238f539..e335d4f 100644 --- a/Frontend/src/tests/MainPage.test.tsx +++ b/Frontend/src/tests/MainPage.test.tsx @@ -338,10 +338,10 @@ describe('MainPage', () => { expect(await screen.findByText('No games found.')).toBeTruthy() expect(await screen.findAllByText('No games found for this genre.')).toHaveLength(1) - expect(screen.getAllByText('No discount games found for this genre.')).toHaveLength(1) + expect(screen.getAllByText('No discounted games found for this genre.')).toHaveLength(1) expect( within(SectionOf('Top 10 Games by Genre')).queryByText( - 'No discount games found for this genre.' + 'No discounted games found for this genre.' ) ).toBeNull() expect((screen.getAllByLabelText('Choose a genre')[0] as HTMLSelectElement).disabled).toBe( @@ -361,7 +361,7 @@ describe('MainPage', () => { const discountSection = SectionOf('Discounts by Genre') expect( - await within(discountSection).findByText('No discount games found for this genre.') + await within(discountSection).findByText('No discounted games found for this genre.') ).toBeTruthy() expect(within(discountSection).queryByText('No games found for this genre.')).toBeNull() expect(within(discountSection).queryByText('Game 1')).toBeNull() diff --git a/Frontend/src/tests/ReviewCard.test.tsx b/Frontend/src/tests/ReviewCard.test.tsx index f7006d8..8e5c8e1 100644 --- a/Frontend/src/tests/ReviewCard.test.tsx +++ b/Frontend/src/tests/ReviewCard.test.tsx @@ -81,10 +81,10 @@ describe('ReviewCard', () => { expect(screen.getByText('Review by TestUser (you)')).toBeTruthy() - fireEvent.click(screen.getByRole('button', { name: 'Edit' })) + fireEvent.click(screen.getByRole('button', { name: 'Edit review' })) expect(onEdit).toHaveBeenCalledWith(testReview) - fireEvent.click(screen.getByRole('button', { name: 'Delete' })) + fireEvent.click(screen.getByRole('button', { name: 'Delete review' })) expect(onDelete).toHaveBeenCalledWith(testReview) }) @@ -92,15 +92,15 @@ describe('ReviewCard', () => { RenderReviewCard({ currentUserId: 8, onEdit: vi.fn(), onDelete: vi.fn() }) expect(screen.getByText('Review by TestUser')).toBeTruthy() - expect(screen.queryByRole('button', { name: 'Edit' })).toBeNull() - expect(screen.queryByRole('button', { name: 'Delete' })).toBeNull() + expect(screen.queryByRole('button', { name: 'Edit review' })).toBeNull() + expect(screen.queryByRole('button', { name: 'Delete review' })).toBeNull() }) it('has no edit or delete buttons for the owner when no handlers are given, like on the main page', () => { RenderReviewCard({ currentUserId: 7 }) expect(screen.getByText('Review by TestUser (you)')).toBeTruthy() - expect(screen.queryByRole('button', { name: 'Edit' })).toBeNull() + expect(screen.queryByRole('button', { name: 'Edit review' })).toBeNull() }) describe('collapsible, like on "Your reviews"', () => { @@ -209,7 +209,7 @@ describe('ReviewCard', () => { onDelete: vi.fn() }) - fireEvent.click(screen.getByRole('button', { name: 'Edit' })) + fireEvent.click(screen.getByRole('button', { name: 'Edit review for Dota 2' })) fireEvent.click(screen.getByRole('link', { name: 'See this game' })) expect(onEdit).toHaveBeenCalled() diff --git a/Frontend/src/tests/UserReviews.test.tsx b/Frontend/src/tests/UserReviews.test.tsx index be1bb6d..629bbcb 100644 --- a/Frontend/src/tests/UserReviews.test.tsx +++ b/Frontend/src/tests/UserReviews.test.tsx @@ -115,7 +115,7 @@ describe('UserReviews', () => { RenderUserReviews() await screen.findByText('Dota 2') - fireEvent.click(screen.getAllByRole('button', { name: 'Edit' })[1]) + fireEvent.click(screen.getAllByRole('button', { name: /^Edit review for / })[1]) expect(screen.getByText('Edit your review of Dota 2')).toBeTruthy() fireEvent.change(screen.getByLabelText('Review (optional)'), { @@ -138,7 +138,7 @@ describe('UserReviews', () => { RenderUserReviews() await screen.findByText('Counter-Strike 2') - fireEvent.click(screen.getAllByRole('button', { name: 'Delete' })[0]) + fireEvent.click(screen.getAllByRole('button', { name: /^Delete review for / })[0]) await vi.waitFor(() => expect(screen.queryByText('Counter-Strike 2')).toBeNull()) expect(DeleteReview).toHaveBeenCalledWith(730, 2, 7) @@ -161,7 +161,7 @@ describe('UserReviews', () => { await screen.findByText('Game 1') fireEvent.click(screen.getAllByRole('button', { name: 'Go to page 2' })[0]) await screen.findByText('Game 7') - fireEvent.click(screen.getByRole('button', { name: 'Delete' })) + fireEvent.click(screen.getByRole('button', { name: /^Delete review for / })) await screen.findByText('Game 1') expect(GetReviewsByUser).toHaveBeenLastCalledWith(7, 1) @@ -175,7 +175,7 @@ describe('UserReviews', () => { RenderUserReviews() await screen.findByText('Dota 2') - fireEvent.click(screen.getByRole('button', { name: 'Delete' })) + fireEvent.click(screen.getByRole('button', { name: /^Delete review for / })) expect((await screen.findByRole('alert')).textContent).toBe( 'You can only delete your own reviews.' diff --git a/Frontend/src/types/Profile.ts b/Frontend/src/types/Profile.ts index 0b036d7..5ca10bb 100644 --- a/Frontend/src/types/Profile.ts +++ b/Frontend/src/types/Profile.ts @@ -3,4 +3,4 @@ export interface Profile { description: string | null setup: string | null favouriteGame: number | null -} \ No newline at end of file +} diff --git a/eslint.config.js b/eslint.config.js index d7a7f74..216609c 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -13,7 +13,6 @@ export default defineConfig([ extends: [ js.configs.recommended, tseslint.configs.recommended, - reactHooks.configs.flat.recommended, reactRefresh.configs.vite, prettier, ], @@ -32,4 +31,8 @@ export default defineConfig([ ], }, }, + { + files: ['Frontend/**/*.{ts,tsx}'], + extends: [reactHooks.configs.flat.recommended], + }, ]) diff --git a/package.json b/package.json index 216f2de..4b78f97 100644 --- a/package.json +++ b/package.json @@ -1,72 +1,72 @@ { - "name": "t10-project-2", - "private": true, - "version": "0.0.0", - "type": "module", - "scripts": { - "dev": "vite", - "build": "tsc -b && vite build", - "lint": "eslint .", - "preview": "vite preview", - "format": "prettier --write \"Frontend/**/*.{ts,tsx,css,md}\" \"Backend/**/*.{ts,tsx,css,md}\" \"Database/**/*.{ts,tsx,css,md}\"", - "format:check": "prettier --check \"Frontend/**/*.{ts,tsx,css,md}\" \"Backend/**/*.{ts,tsx,css,md}\" \"Database/**/*.{ts,tsx,css,md}\"", - "test": "vitest", - "test:ui": "vitest --ui", - "test:coverage": "vitest run --coverage", - "test:e2e": "playwright test", - "test:e2e:ui": "playwright test --ui", - "test:api": "playwright test -c playwright.api.config.ts", - "server": "node Backend/Server.ts", - "db:create": "node Database/CreateTables.ts", - "db:fill": "node Database/FillDb.ts", - "db:fill:genres": "node Database/FillGenres.ts", - "server:local": "node --env-file=Frontend/.env.development Backend/Server.ts", - "db:create:local": "node --env-file=Frontend/.env.development Database/CreateTables.ts", - "db:fill:local": "node --env-file=Frontend/.env.development Database/FillDb.ts", - "db:fill:genres:local": "node --env-file=Frontend/.env.development Database/FillGenres.ts" - }, - "dependencies": { - "@apollo/server": "^5.5.1", - "@emotion/react": "^11.14.0", - "@emotion/styled": "^11.14.1", - "@material/card": "^14.0.0", - "@mui/material": "^9.4.0", - "@types/bcrypt": "^6.0.0", - "bcrypt": "^6.0.0", - "dotenv": "^18.0.7", - "graphql": "^16.14.2", - "lucide-react": "^1.48.0", - "monocart-coverage-reports": "^3.2.1", - "pg": "^8.23.1", - "react": "^19.2.8", - "react-dom": "^19.2.8", - "react-router-dom": "^7.18.4" - }, - "devDependencies": { - "@eslint/js": "^10.0.1", - "@playwright/test": "^1.65.0", - "@testing-library/jest-dom": "^7.0.1", - "@testing-library/react": "^16.3.3", - "@testing-library/user-event": "^14.6.7", - "@types/bcrypt": "^6.0.0", - "@types/node": "^24.13.3", - "@types/pg": "^8.23.1", - "@types/react": "^19.2.18", - "@types/react-dom": "^19.2.7", - "@vitejs/plugin-react": "^6.1.1", - "@vitest/coverage-v8": "^5.0.5", - "@vitest/ui": "^5.0.5", - "eslint": "^10.10.0", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-react-hooks": "^7.1.1", - "eslint-plugin-react-refresh": "^0.5.6", - "globals": "^17.12.0", - "jsdom": "^29.1.1", - "monocart-reporter": "^2.15.1", - "prettier": "^3.9.8", - "typescript": "~6.0.2", - "typescript-eslint": "^8.69.0", - "vite": "^8.3.0", - "vitest": "^5.0.5" - } + "name": "t10-project-2", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview", + "format": "prettier --write \"Frontend/**/*.{ts,tsx,css,md}\" \"Backend/**/*.{ts,tsx,css,md}\" \"Database/**/*.{ts,tsx,css,md}\"", + "format:check": "prettier --check \"Frontend/**/*.{ts,tsx,css,md}\" \"Backend/**/*.{ts,tsx,css,md}\" \"Database/**/*.{ts,tsx,css,md}\"", + "test": "vitest", + "test:ui": "vitest --ui", + "test:coverage": "vitest run --coverage", + "test:e2e": "playwright test", + "test:e2e:ui": "playwright test --ui", + "test:api": "playwright test -c playwright.api.config.ts", + "server": "node Backend/Server.ts", + "db:create": "node Database/CreateTables.ts", + "db:fill": "node Database/FillDb.ts", + "db:fill:genres": "node Database/FillGenres.ts", + "server:local": "node --env-file=Frontend/.env.development Backend/Server.ts", + "db:create:local": "node --env-file=Frontend/.env.development Database/CreateTables.ts", + "db:fill:local": "node --env-file=Frontend/.env.development Database/FillDb.ts", + "db:fill:genres:local": "node --env-file=Frontend/.env.development Database/FillGenres.ts" + }, + "dependencies": { + "@apollo/server": "^5.5.1", + "@emotion/react": "^11.14.0", + "@emotion/styled": "^11.14.1", + "@material/card": "^14.0.0", + "@mui/material": "^9.4.0", + "@types/bcrypt": "^6.0.0", + "bcrypt": "^6.0.0", + "dotenv": "^18.0.7", + "graphql": "^16.14.2", + "lucide-react": "^1.48.0", + "monocart-coverage-reports": "^3.2.1", + "pg": "^8.23.1", + "react": "^19.2.8", + "react-dom": "^19.2.8", + "react-router-dom": "^7.18.4" + }, + "devDependencies": { + "@eslint/js": "^10.0.1", + "@playwright/test": "^1.65.0", + "@testing-library/jest-dom": "^7.0.1", + "@testing-library/react": "^16.3.3", + "@testing-library/user-event": "^14.6.7", + "@types/bcrypt": "^6.0.0", + "@types/node": "^24.13.3", + "@types/pg": "^8.23.1", + "@types/react": "^19.2.18", + "@types/react-dom": "^19.2.7", + "@vitejs/plugin-react": "^6.1.1", + "@vitest/coverage-v8": "^5.0.5", + "@vitest/ui": "^5.0.5", + "eslint": "^10.10.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-react-hooks": "^7.1.1", + "eslint-plugin-react-refresh": "^0.5.6", + "globals": "^17.12.0", + "jsdom": "^29.1.1", + "monocart-reporter": "^2.15.1", + "prettier": "^3.9.8", + "typescript": "~6.0.2", + "typescript-eslint": "^8.69.0", + "vite": "^8.3.0", + "vitest": "^5.0.5" + } }