-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: made page.tsx testing that passes but has an error.
- Loading branch information
1 parent
1559c7d
commit 798ff07
Showing
1 changed file
with
10 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(<AdminLeagues />); | ||
}) | ||
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 | ||
}); | ||
}); | ||
}); |