Skip to content

Commit

Permalink
updated test register.spec and also buttonGuest
Browse files Browse the repository at this point in the history
  • Loading branch information
okeinom committed Sep 20, 2023
1 parent 59eafbe commit fabfce0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/molecules/buttonGuest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function ButtonGuest({
<div className={clsx(styles.wrapper, className)}>
<button
className={styles.link}
data-testid="guest-info-button"
data-testid="guest-info-button2"
onClick={(e) => {
e.preventDefault();
setIsGuestModalOpen(true);
Expand Down
8 changes: 8 additions & 0 deletions src/containers/account/register.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,14 @@ describe('register page', () => {

expect(getByText('Continue as guest?')).toBeInTheDocument();
});

it('pops modal on guest info click', async () => {
const { getByText, getByTestId } = await renderPage();

await userEvent.click(getByTestId('guest-info-button2'));

expect(getByText('Continue as guest?')).toBeInTheDocument();
});
});

// link to login form on registration success
Expand Down

0 comments on commit fabfce0

Please sign in to comment.