Skip to content

Commit

Permalink
make test a bit more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterlukasse committed Oct 13, 2022
1 parent bee095b commit 14e88b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/UserProfile/UserProfile.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ describe('the UserProfile component', () => {
/>
</StaticRouter>,
);
expect($vdom.find('tbody tr')).toHaveLength(testProps.userProfile.jtis.length);
// we expect one delete button per jti:
expect($vdom.find(`button[name="${DELETE_BTN}"]`)).toHaveLength(testProps.userProfile.jtis.length);
});

it('triggers create-key events', (done) => {
Expand Down Expand Up @@ -79,7 +80,7 @@ describe('the UserProfile component', () => {
</StaticRouter>,
);
const $deleteBtn = $vdom.find(`button[name="${DELETE_BTN}"]`);
expect($deleteBtn).toHaveLength($vdom.find('tbody tr').length);
expect($deleteBtn).toHaveLength(testProps.userProfile.jtis.length);
$deleteBtn.at(0).simulate('click');
// should invoke onRequestDeleteKey callback (above - calls done()) ...
});
Expand Down

0 comments on commit 14e88b6

Please sign in to comment.