Skip to content

Commit

Permalink
Add test for missed lines
Browse files Browse the repository at this point in the history
  • Loading branch information
skbhagat0502 committed Nov 15, 2023
1 parent f58c669 commit c116e9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/screens/MemberDetail/MemberDetail.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ describe('MemberDetail', () => {
expect(screen.getAllByText(/Role/i)).toHaveLength(2);
expect(screen.getAllByText(/Created/i)).toHaveLength(4);
expect(screen.getAllByText(/Joined/i)).toHaveLength(2);
expect(screen.getByTestId('stateBtn')).toBeInTheDocument();
userEvent.click(screen.getByTestId('stateBtn'));
});
test('prettyDate function should work properly', () => {
// If the date is provided
Expand Down Expand Up @@ -250,12 +252,10 @@ describe('MemberDetail', () => {
)
);
});

test('should call setState with 2 when button is clicked', async () => {
const props = {
id: 'rishav-jha-mech',
};

const { container } = render(
<MockedProvider addTypename={false} link={link1}>
<BrowserRouter>
Expand Down
1 change: 1 addition & 0 deletions src/screens/MemberDetail/MemberDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const MemberDetail: React.FC<MemberDetailProps> = ({ id }): JSX.Element => {
<Button
className={styles.memberfontcreatedbtn}
role="stateBtn"
data-testid="stateBtn"
onClick={(): void => {
setState(2);
}}
Expand Down

0 comments on commit c116e9a

Please sign in to comment.