-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CIF-1328: Refactor the Create Account process #274
Conversation
refactored AuthBar to use context
Component is displayed when account creation succeeds
</MockedProvider> | ||
); | ||
|
||
expect(getByText('Sign in')).not.toBeUndefined(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(getByText('Sign in'))
should be sufficient, since the getBy*
query throws an error if an element cannot be found. See https://testing-library.com/docs/dom-testing-library/api-queries#getby.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True but expect
is rarely used without a matcher.
It also fails linting.
expect(getByText('Sign in')).not.toBeUndefined(); | ||
|
||
fireEvent.click(getByText('Sign in')); | ||
const result = await waitForElement(() => getByTestId('sign_in')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. You could write:
await waitForElement(() => getByTestId('sign_in')); // fails if element cannot be found after timeout
expect(result.textContent).toEqual('Sign in page');
Codecov Report
@@ Coverage Diff @@
## master #274 +/- ##
============================================
+ Coverage 63.15% 63.58% +0.43%
Complexity 757 757
============================================
Files 173 175 +2
Lines 5368 5440 +72
Branches 843 853 +10
============================================
+ Hits 3390 3459 +69
- Misses 1861 1864 +3
Partials 117 117
Continue to review full report at Codecov.
|
Description
Your account was successfully created. You will receive a link at {{email}}. Access that link to confirm your email address.
and aSign in
button.Related Issue
CIF-1328
Motivation and Context
In our current implementation, the Create Account process automatically logs in the user after the account is created. This goes against the good practices in the industry because usually
Create Account
andSign in
are two separate user actions.How Has This Been Tested?
Types of changes
Checklist: