This repository was archived by the owner on Jan 11, 2023. It is now read-only.
fixed the unnecessary firing of TOGGLE_PROJECT_SEARCH action#2882
Merged
Conversation
jasonLaster
reviewed
May 12, 2017
| } else { | ||
| dispatch({ | ||
| const projectSearchState = getProjectSearchState(getState()); | ||
| if (toggleValue === null) { |
Contributor
There was a problem hiding this comment.
my bet is that this should be undefined.
Here's the failing test. https://github.com/jasonLaster/debugger.html/blob/preview-story/src/actions/tests/ui.js#L15-L22
You can run it with jest. jest src/actions/ and make changes to debug it :)
Contributor
Author
There was a problem hiding this comment.
Test passes after changing null to undefined!
Contributor
|
Great
…On Fri, May 12, 2017 at 8:37 PM Karthik ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/actions/ui.js
<#2882 (comment)>
:
> @@ -10,17 +10,22 @@ import type { SymbolSearchType } from "../reducers/ui";
export function toggleProjectSearch(toggleValue?: boolean) {
return ({ dispatch, getState }: ThunkArgs) => {
- if (toggleValue != null) {
- dispatch({
- type: constants.TOGGLE_PROJECT_SEARCH,
- value: toggleValue
- });
- } else {
- dispatch({
+ const projectSearchState = getProjectSearchState(getState());
+ if (toggleValue === null) {
Test passes after changing null to undefined!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2882 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPiYkdYFl8gJcySzAYn0Bnvgvh0WRGWks5r5LUVgaJpZM4NZhfx>
.
|
Codecov Report
@@ Coverage Diff @@
## master #2882 +/- ##
==========================================
+ Coverage 58.53% 58.66% +0.13%
==========================================
Files 63 63
Lines 2390 2371 -19
Branches 490 488 -2
==========================================
- Hits 1399 1391 -8
+ Misses 991 980 -11
Continue to review full report at Codecov.
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Associated Issue: #2800
I made the necessary changes looking at the issue description. However, the test fails when I try to push the changes.
Am only beginning to learn Redux now, how do I proceed further?