Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into alex/implement-adm…
Browse files Browse the repository at this point in the history
…in-league-operation
  • Loading branch information
alexappleget committed Oct 31, 2024
2 parents 6a7650a + 96d4679 commit adffce8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions components/AlertTItle/AlertTitle.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import { render } from '@testing-library/react';
import { AlertTitle } from './AlertTitle';

describe('AlertTitle', () => {
it('renders the title text', () => {
const { getByText } = render(<AlertTitle title="Test Title" />);
expect(getByText('Test Title')).toBeInTheDocument();
});
});
4 changes: 2 additions & 2 deletions utils/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,14 @@ describe('utils', () => {
});
});

xdescribe('getUserLeagues', () => {
describe('getUserLeagues', () => {
it('should return the list of leagues the user is a part of', async () => {
(getCurrentLeague as jest.Mock).mockResolvedValue(mockLeague);
const result = await getUserLeagues(mockUserData.leagues);
expect(result).toStrictEqual([mockLeague]);
});
it('should return an empty array if the user has no leagues', async () => {
const result = await getUserLeagues([]);
const result = await getUserLeagues(['']);
expect(getCurrentLeague).toHaveBeenCalledTimes(0);
expect(result).toStrictEqual([]);
});
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const parseUserPick = (
export const getUserLeagues = async (
leagues: IUser['leagues'],
): Promise<ILeague[]> => {
if (!leagues || leagues.length === 0) {
if (!leagues || leagues[0] === '') {
return [];
}
const userLeagues = leagues.map((league) => {
Expand Down

0 comments on commit adffce8

Please sign in to comment.