-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add JavaScript tests for the PhoneNumberCard
component
#2027
Conversation
mockLoaded( false ); | ||
const { rerender } = render( | ||
<PhoneNumberCard phoneNumber={ phoneNumber } /> | ||
); |
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.
I guess this can be omitted.
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.
This is to simulate the state change of "after loading a verified phone number".
expect( button ).not.toBeInTheDocument(); | ||
} ); | ||
|
||
it( 'When `initEditing` is not specified, should render in display mode after loading a verified phone number', () => { |
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.
"display mode" doesn't explain much. I guess it would be more accurate to say
should render the edit button after loading a verified phone number
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.
The mode for entering verification code also has an edit button. Changed to use "non-editing mode" in ca7ce02.
mockLoaded( false ); | ||
const { rerender } = render( | ||
<PhoneNumberCard phoneNumber={ phoneNumber } /> | ||
); |
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.
I guess same as before, this seems not necessary
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.
This is to simulate the state change of "after loading an unverified phone number".
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.
✅ LGTM
Tests pass and seem to cover all the scenarios.
…oneNumberCard` tests. Address: #2027 (comment)
Changes proposed in this Pull Request:
This is a part of 📌 Add tests in #1993.
Before adding tests for the
VerifyPhoneNumberContent
component, I would like to add tests for thePhoneNumberCard
component first.Detailed test instructions:
Changelog entry