-
Notifications
You must be signed in to change notification settings - Fork 10
reverted EmptySearchResult, copied newest develop branch, formatted S… #951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,7 @@ describe('Search Results Screen', () => { | |
| expect(headerText).toBeInTheDocument(); | ||
| expect(within(headerText).getByText('iron man')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('empty search results displayed when no data is returned', async () => { | ||
| vi.mocked(useTrendingShows).mockReturnValue({ | ||
| trendingShows: TRENDING_DATA, | ||
|
|
@@ -63,6 +64,7 @@ describe('Search Results Screen', () => { | |
| const button = screen.getByRole('button', { name: 'Return Home' }); | ||
| expect(button).toHaveTextContent('Return Home'); | ||
| }); | ||
|
|
||
| it('search results gallery displayed when data is returned', async () => { | ||
| vi.mocked(usePaginatedData).mockReturnValue({ | ||
| data: TRENDING_DATA, | ||
|
|
@@ -78,22 +80,5 @@ describe('Search Results Screen', () => { | |
| const headerText = screen.getByText('Search results for:'); | ||
| expect(headerText).toBeInTheDocument(); | ||
| expect(within(headerText).getByText('iron man')).toBeInTheDocument(); | ||
| expect(screen.getByText('Load More')).toBeInTheDocument(); | ||
| expect(screen.getByText('Load More')).toHaveAttribute('disabled'); | ||
| }); | ||
| it('a clickable "Load More" button is displayed when `moreToFetch` is true', async () => { | ||
| vi.mocked(usePaginatedData).mockReturnValue({ | ||
| data: TRENDING_DATA, | ||
| setData: () => {}, | ||
| loading: false, | ||
| moreToFetch: true, | ||
| refetch: () => {}, | ||
| }); | ||
|
|
||
| render(<RouterProvider router={router} />); | ||
|
|
||
| await screen.findByTestId('search-results-screen'); | ||
| expect(screen.getByText('Load More')).toBeInTheDocument(); | ||
| expect(screen.getByText('Load More')).not.toHaveAttribute('disabled'); | ||
|
Comment on lines
-84
to
-97
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we could test for the loading spinner, but I think I am fine to break that out into a new issue as it might be difficult.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed the tests for the Load More Button since it was replaced with the LoafingIndicator |
||
| }); | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import React from 'react'; | ||
|
|
||
| const LoadingIndicator: React.FC = () => { | ||
| return ( | ||
| <div className='flex items-center justify-center mb-4 mt-4'> | ||
| <div className='w-6 h-6 border-4 border-blue-500 border-t-transparent rounded-full animate-spin'></div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default LoadingIndicator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was by accident, I am sorry.