Skip to content
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

fix: Correct selection of menu item in Navigation drawer #1416

Merged
merged 5 commits into from
Jan 6, 2019

Conversation

kush-mish
Copy link
Contributor

Fixes #1383

Checklist:

  • I have checked for PMD and check-style issues
  • I have read the Contribution & Best practices Guide and my PR follows them.
  • My branch is up-to-date with the Upstream development branch.

Note: This bug was not afflicting only the Attendees fragment having the Activity Log as a subfragment but, every other fragment having subfragments.

Changes: Correct menu item is selected in Navigation drawer even when the back button is pressed from a subfragment.

Screenshot after the change:
alt text

@ci-reporter
Copy link

ci-reporter bot commented Jan 1, 2019

The build is failing

✨ Good work on this PR so far! ✨ Unfortunately, the Circle CI build is failing as of 962cd2b. Here's the output:

Test Coverage
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

I'm sure you can fix it! If you need help, don't hesitate to ask a maintainer of the project!


This comment was automagically generated by ci-reporter. If you see a problem, open an issue here.

1 similar comment
@ci-reporter
Copy link

ci-reporter bot commented Jan 1, 2019

The build is failing

✨ Good work on this PR so far! ✨ Unfortunately, the Circle CI build is failing as of 962cd2b. Here's the output:

Test Coverage
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

I'm sure you can fix it! If you need help, don't hesitate to ask a maintainer of the project!


This comment was automagically generated by ci-reporter. If you see a problem, open an issue here.

@kush-mish
Copy link
Contributor Author

@iamareebjamal, please help me with the test

@iamareebjamal
Copy link
Member

Tests are failing. Fix them

@kush-mish
Copy link
Contributor Author

The testBack() function in FragmentNavigator.java is asserting that the dashboard should be active after pressing back, which seems implausible since when inside a subfragment pressing back will lead to the fragment and not the dashboard.
https://github.com/fossasia/open-event-orga-app/blob/c116c294992905348b3bbc1b6a057fe31e382b3c/app/src/test/java/com/eventyay/organizer/core/main/FragmentNavigatorTest.java#L111-L129
That's why line 126 is causing error.

@iamareebjamal
Copy link
Member

True, add a test case for that and fix this issue

@codecov
Copy link

codecov bot commented Jan 4, 2019

Codecov Report

Merging #1416 into development will increase coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@               Coverage Diff                @@
##             development   #1416      +/-   ##
================================================
+ Coverage          24.29%   24.3%   +<.01%     
  Complexity           757     757              
================================================
  Files                237     237              
  Lines               8718    8720       +2     
  Branches             352     353       +1     
================================================
+ Hits                2118    2119       +1     
  Misses              6517    6517              
- Partials              83      84       +1
Impacted Files Coverage Δ Complexity Δ
...com/eventyay/organizer/core/main/MainActivity.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ventyay/organizer/core/main/FragmentNavigator.java 39.65% <80%> (+0.36%) 6 <1> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32fcb1f...1ac839f. Read the comment docs.

assertTrue(fragmentNavigator.isDashboardActive());
if (fragmentManager.getBackStackEntryCount() == 1)
assertTrue(fragmentNavigator.isDashboardActive());
else assertFalse(fragmentNavigator.isDashboardActive());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No if statements in tests

@fossasia fossasia deleted a comment Jan 5, 2019
@fossasia fossasia deleted a comment Jan 6, 2019
@fossasia fossasia deleted a comment Jan 6, 2019
@iamareebjamal iamareebjamal merged commit 712aa5b into fossasia:development Jan 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants