[BOOKINGSG-9329][GZ] phone number input visual test#1185
Open
ghazwan-gt wants to merge 2 commits into
Open
Conversation
qroll
requested changes
May 15, 2026
Comment on lines
+132
to
+152
| it("should update the selector label and reformat the number when a country is selected", () => { | ||
| render( | ||
| <PhoneNumberInput | ||
| value={{ countryCode: "+994", number: "12345678" }} | ||
| /> | ||
| ); | ||
|
|
||
| fireEvent.click(screen.getByTestId(SELECTOR_TESTID)); | ||
| fireEvent.click( | ||
| screen.getByRole("option", { name: /Singapore/i }) | ||
| ); | ||
|
|
||
| expect(screen.queryByTestId(SELECTOR_TESTID)).toHaveTextContent( | ||
| "+65" | ||
| ); | ||
| expect(screen.queryByTestId(INPUT_TESTID)).toHaveValue( | ||
| "1234 5678" | ||
| ); | ||
| }); | ||
|
|
||
| it("should call onChange with the reformatted number and new country code when a country is selected", () => { |
Contributor
There was a problem hiding this comment.
this is the same scenario? we could combine into 1 test case
| screen.getByRole("option", { name: /Singapore/i }) | ||
| ); | ||
|
|
||
| expect(onChange).not.toHaveBeenCalled(); |
Contributor
There was a problem hiding this comment.
hmm this assertion doesn't seem useful
Comment on lines
+14
to
+18
| <Form.PhoneNumberInput | ||
| data-testid="phone-number-input-selected" | ||
| label="Selected" | ||
| value={{ countryCode: "+213", number: "91234567" }} | ||
| /> |
Contributor
There was a problem hiding this comment.
separate prefilled into its own form-variants-prefilled page
Contributor
There was a problem hiding this comment.
wrong mode
also looks like the clear button right spacing is incorrect. can address this separately
Contributor
There was a problem hiding this comment.
did you mean to exclude grid-layout? I guess it's covered by InputGroup already
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
classNameis chained correctly withclsxBreaking changes
List breaking style or api changes to be added to the migration docs
Additional information
Provide additional information that might be useful to the reviewer