Repository navigation
Conversation
|
|
thetaPC
commented
May 11, 2023
Comment on lines
+42
to
+43
| expect(ionPickerColChangeEvent.events[0].detail.prevSelected).toBe(0); | ||
| expect(ionPickerColChangeEvent.events[0].detail.selectedIndex).toBe(1); |
Contributor
Author
There was a problem hiding this comment.
Decided to not use toHaveReceivedEventDetail because it returns the entire col object. The test only needs to test the prevSelected and selectedIndex value.
thetaPC
marked this pull request as ready for review
May 11, 2023 20:19
liamdebeasi
approved these changes
May 16, 2023
liamdebeasi
left a comment
Contributor
There was a problem hiding this comment.
Great job! One test change below, but otherwise the code looks good.
Also small nitpick: Can we change "returns" to "is set to" in the PR title? IMO "returns" implies prevSelected is a function.
|
|
||
| await ionPickerDidPresent.next(); | ||
|
|
||
| secondOption.click(); |
Contributor
There was a problem hiding this comment.
Suggested change
| secondOption.click(); | |
| await secondOption.click(); |
click is asynchronous
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
May 16, 2023
brandyscarney
pushed a commit
that referenced
this pull request
May 22, 2023
Issue number: resolves #21764 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> The `prevSelected` returns the same value as `selectedIndex`. When a user has selected the first option then the second: - `prevSelected` returns `1` - `selectedIndex` returns `1` ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> The `prevSelected` returns the index of the last selected option. When a user has selected the first option then the second: - `prevSelected` returns `0` - `selectedIndex` returns `1` ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Read the comment below regarding `toHaveReceivedEventDetail`.
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.
Issue number: resolves #21764
What is the current behavior?
The
prevSelectedreturns the same value asselectedIndex.When a user has selected the first option then the second:
prevSelectedreturns1selectedIndexreturns1What is the new behavior?
The
prevSelectedreturns the index of the last selected option.When a user has selected the first option then the second:
prevSelectedreturns0selectedIndexreturns1Does this introduce a breaking change?
Other information
Read the comment below regarding
toHaveReceivedEventDetail.