Skip to content

Commit

Permalink
--wip-- [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-h1 committed Dec 11, 2024
1 parent ddb1fdd commit d188ec3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/app/blog/page.client.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { posts } from '@frontend/test/__mocks__/post';
import { AppRouterContextProviderMock } from '@frontend/test/appRouterMock';
import render from '@frontend/test/render';
import { screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
Expand Down Expand Up @@ -52,20 +51,15 @@ describe('PostsClient', () => {

await userEvent.type(screen.getByRole('textbox'), 'vault');

screen.debug();
// vault post
expect(screen.queryByText(posts[2].title)).toBeInTheDocument();
expect(screen.queryByText(posts[2].intro)).toBeInTheDocument();

// await waitFor(() => {
// // vault post
// expect(screen.getByText(posts[2].title)).toBeInTheDocument();
// expect(screen.getByText(posts[2].intro)).toBeInTheDocument();
// rest of posts
expect(screen.queryByText(posts[0].title)).not.toBeInTheDocument();
expect(screen.queryByText(posts[0].intro)).not.toBeInTheDocument();

// expect(screen.getByText(posts[0].title)).not.toBeInTheDocument();
// expect(screen.getByText(posts[0].intro)).not.toBeInTheDocument();

// expect(screen.getByText(posts[1].title)).not.toBeInTheDocument();
// expect(screen.getByText(posts[1].intro)).not.toBeInTheDocument();
// });
expect(screen.queryByText(posts[1].title)).not.toBeInTheDocument();
expect(screen.queryByText(posts[1].intro)).not.toBeInTheDocument();
});

test('navigating to url with query param filters posts', async () => {});
});
1 change: 1 addition & 0 deletions src/app/blog/page.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Input from '@frontend/components/Input';
import PostItem from '@frontend/components/PostItem';
import Spacer from '@frontend/components/Spacer';
import { Post } from '@frontend/types/sanity';
import debounce from 'lodash/debounce';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
import { ChangeEvent, useCallback, useState } from 'react';

Expand Down

0 comments on commit d188ec3

Please sign in to comment.