Skip to content

Conversation

@JanBan
Copy link
Contributor

@JanBan JanBan commented Sep 10, 2018

The ability to select an active child in "Add / remove child" section was added.
Section was renamed to "Add/Choose active child", as suggested in https://preview.uxpin.com/dc276af793ed5a347736f473bdabe8c5112f8983#/pages/87956056/simulate/sitemap?mode=i .

I once again struggle with Espresso though - tests were added but Espresso doesn't let them through, despite them working great on production.
Having two breakpoints, in line 110 and 111 of ChildListActivity.java (setActiveChild()), we can see, that if we set any child to active, we will hit the 111 line breakpoint. Then if we set another child to active (meaning we change the active child, as there can only be one at a time), we struck both breakpoints one after another (110 and 111). That proves that the previous one was set correctly.

That does not replicate in espresso though. During assertion, Child.isActive is always false (and always hits only 111 during setting child active). Just as if there were 2 separate databases used - one during action and other during assertion or something wild like that. Returning to the previous activity isn't an issue this time, as I tried removing it at all and it didn't help.

Apart from that everything seems to work fine and the rest of the tests are going through.

JanBan and others added 2 commits September 10, 2018 17:17
The section was renamed to Add/Choose active profile, as suggested in https://preview.uxpin.com/dc276af793ed5a347736f473bdabe8c5112f8983#/pages/87956056/simulate/sitemap?mode=i . Tests were added but Espresso doesn't let them through, despite them working on production.
Copy link
Contributor

@malsolec malsolec left a comment

Choose a reason for hiding this comment

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

Thank you! Sorry for the delay I didn't noticed you needed help. You can always ping me on slack. I found some issues with the task, hope it will help.


private void setActiveChild(){
List<Child> childList = childRepository.getAll();
for (Child child : childList)
Copy link
Contributor

Choose a reason for hiding this comment

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

could you please add brackets here? it would be easier to read.

for (Child child : childList)
if(child.getIsActive())
child.setIsActive(false);
childListAdapter.getChild(selectedChildPosition).setIsActive(true);
Copy link
Contributor

@malsolec malsolec Oct 7, 2018

Choose a reason for hiding this comment

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

When I tested it the active value was not setting, you could select the row but it does not look that the value is stored anywhere. I don't think we update child in db and we should update the record after selected it with is_active to true. In my opinion it should also change the color of the row, when the list is displayed on opening child list view. That is probably implemented now, but one child should always be active and it should be visible on the list. The list should not allow to disactivate all children. Could you please verify it?

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.

3 participants