diff --git a/app/(admin)/admin/leagues/page.test.tsx b/app/(admin)/admin/leagues/page.test.tsx index 9a08ff5b..9ee9a21f 100644 --- a/app/(admin)/admin/leagues/page.test.tsx +++ b/app/(admin)/admin/leagues/page.test.tsx @@ -1,12 +1,20 @@ import { render, screen, waitFor } from '@testing-library/react'; import AdminLeagues from './page'; +jest.mock('@/store/dataStore', () => ({ + useDataStore: jest.fn().mockReturnValue({ + user: { leagues: ['league1', 'league2'] }, + }), +})); + describe('AdminLeagues', () => { beforeEach(() => { render(); }) it('should render the League data table component', async () => { - const leagueTable = screen.getByTestId('data-table'); - expect(leagueTable).toBe(1); + await waitFor(() => { + const leagueTable = screen.getByTestId('data-table'); + expect(leagueTable).toBeInTheDocument(); // Verifies table is present + }); }); });