@@ -8,6 +8,13 @@ vi.mock("next/navigation", () => ({
88 redirect : vi . fn ( ) ,
99} ) ) ;
1010
11+ // Mock next/font/google
12+ vi . mock ( "next/font/google" , ( ) => ( {
13+ Cinzel : ( ) => ( {
14+ className : "mocked-cinzel-font" ,
15+ } ) ,
16+ } ) ) ;
17+
1118// Mock Supabase server client to return a fake authenticated user
1219vi . mock ( "../../../lib/supabase/server" , ( ) => ( {
1320 createClient : vi . fn ( async ( ) => ( {
@@ -36,16 +43,10 @@ describe("Dashboard Page Tests", () => {
3643 expect ( screen . getByText ( "Dashboard" ) ) . toBeInTheDocument ( ) ;
3744 } ) ;
3845
39- it ( "should display the user email" , async ( ) => {
40- const page = await DashboardPage ( ) ;
41- render ( page ) ;
42- expect ( screen . getByText ( "[email protected] " ) ) . toBeInTheDocument ( ) ; 43- } ) ;
44-
4546 it ( "should render the home link" , async ( ) => {
4647 const page = await DashboardPage ( ) ;
4748 render ( page ) ;
48- expect ( screen . getByRole ( "link" , { name : / G o h o m e / i } ) ) . toBeInTheDocument ( ) ;
49+ expect ( screen . getByRole ( "link" , { name : / H o m e / i } ) ) . toBeInTheDocument ( ) ;
4950 } ) ;
5051
5152 it ( "should render the logout button" , async ( ) => {
@@ -57,6 +58,12 @@ describe("Dashboard Page Tests", () => {
5758 it ( "should render the tutorial link" , async ( ) => {
5859 const page = await DashboardPage ( ) ;
5960 render ( page ) ;
60- expect ( screen . getByRole ( "link" , { name : / H e l l o W o r l d T u t o r i a l / i } ) ) . toBeInTheDocument ( ) ;
61+ expect ( screen . getByRole ( "link" , { name : / H e l l o W o r l d / i } ) ) . toBeInTheDocument ( ) ;
62+ } ) ;
63+
64+ it ( "should render the profile button" , async ( ) => {
65+ const page = await DashboardPage ( ) ;
66+ render ( page ) ;
67+ expect ( screen . getByRole ( "link" , { name : / P r o f i l e / i } ) ) . toBeInTheDocument ( ) ;
6168 } ) ;
6269} ) ;
0 commit comments