Skip to content

Commit

Permalink
test for memberDetail
Browse files Browse the repository at this point in the history
  • Loading branch information
nitishkumar333 committed Jan 25, 2024
1 parent 5c3dd36 commit 3b6f077
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/screens/MemberDetail/MemberDetail.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('MemberDetail', () => {
};

render(
<MockedProvider addTypename={false} link={link1}>
<MockedProvider addTypename={false} link={link2}>
<BrowserRouter>
<Provider store={store}>
<I18nextProvider i18n={i18nForTest}>
Expand Down Expand Up @@ -208,16 +208,13 @@ describe('MemberDetail', () => {
);

expect(screen.queryByText('Loading data...')).not.toBeInTheDocument();
await wait();

const user = MOCKS1[0].result.data.user;

waitFor(() =>
expect(screen.getByTestId('userImageAbsent')).toBeInTheDocument()
);
waitFor(() =>
expect(screen.getByTestId('userImageAbsent').getAttribute('src')).toBe(
`https://api.dicebear.com/5.x/initials/svg?seed=${user?.firstName} ${user?.lastName}`
)
expect(screen.getByTestId('userImageAbsent')).toBeInTheDocument();
expect(screen.getByTestId('userImageAbsent').getAttribute('src')).toBe(
`https://api.dicebear.com/5.x/initials/svg?seed=${user?.firstName} ${user?.lastName}`
);
});

Expand Down

0 comments on commit 3b6f077

Please sign in to comment.