Skip to content

Commit

Permalink
Fixes #1514 added the test for the PostCard and Home.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravsingh94 committed Mar 22, 2024
1 parent b7fe98a commit d89bdf4
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/screens/UserPortal/Home/Home.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ const MOCKS = [
},
{
_id: '6411e54835d7ba2344a78e29',
title: 'posttwo',
text: 'THis is the post two',
title: 'Non pinned post',
text: 'This is a feed post which is non pinned',
imageUrl: null,
videoUrl: null,
creator: {
Expand Down Expand Up @@ -381,4 +381,25 @@ describe('Testing Home Screen [User Portal]', () => {
const PostText = screen.getByText('This is the frist post');
expect(PostText).toBeInTheDocument();
});
test('Non pinned post should be visible in the feed section.', async () => {
render(
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
<Provider store={store}>
<I18nextProvider i18n={i18nForTest}>
<Home />
</I18nextProvider>
</Provider>
</BrowserRouter>
</MockedProvider>,
);
await wait();

const PostTitle = screen.getByText('Non pinned post');
expect(PostTitle).toBeInTheDocument();
const PostText = screen.getByText(
'This is a feed post which is non pinned',
);
expect(PostText).toBeInTheDocument();
});
});

0 comments on commit d89bdf4

Please sign in to comment.