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 part of #1587: Made intent keys consistent in the drawer, topic and testing packages in the app module #2590

Conversation

janewaitara
Copy link
Contributor

Explanation

Fixes part of #1587 : Made intent keys consistent in the drawer, topic and testing packages in the app module.

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The PR follows the style guide.
  • The PR does not contain any unnecessary auto-generated code from Android Studio.
  • The PR is made from a branch that's not called "develop".
  • The PR is made from a branch that is up-to-date with "develop".
  • The PR's branch is based on "develop" and not on any other branch.
  • The PR is assigned to an appropriate reviewer in both the Assignees and the Reviewers sections.

@janewaitara
Copy link
Contributor Author

@rt4914 PTAL

@janewaitara
Copy link
Contributor Author

Please recommend how I can solve the roboelectric tests that are failing.

Copy link
Contributor

@anandwana001 anandwana001 left a comment

Choose a reason for hiding this comment

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

The test is failing due to changes in TopicActivity, but in the test testProfileProgressFragment_clickFirstStory_opensTopicActivity the recorded intent is the earlier one.

IntentMatcher: has extras: has bundle with: key: is "TopicActivity.topic_activity_topic_id" value: is "test_topic_id_0"

Matched intents:[]

Recorded intents:
-Intent { cmp=org.oppia.android/.app.topic.TopicActivity (has extras) } handling packages:[[org.oppia.android]], extras:[Bundle[{NavigationDrawerFragment.navigation_profile_id=0, TopicActivity.topic_id=test_topic_id_0, TopicActivity.story_id=test_story_id_0}]])

Look for all the test using these functions from TopicActivity, are they passing on Espresso and Robolectric both or not.

fun getProfileIdKey(): String {
    return NAVIGATION_DRAWER_PROFILE_ID_ARGUMENT_KEY
}

fun getTopicIdKey(): String {
    return TOPIC_ACTIVITY_TOPIC_ID_EXTRA_KEY
}

fun getStoryIdKey(): String {
    return TOPIC_ACTIVITY_STORY_ID_EXTRA_KEY
}

Copy link
Contributor

@rt4914 rt4914 left a comment

Choose a reason for hiding this comment

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

@janewaitara The naming is incorrect.

For KEY_NAVIGATION_PROFILE_ID you have named it correctly as NAVIGATION_DRAWER_PROFILE_ID_ARGUMENT_KEY which makes sense considering that this const is getting used in various other files and therefore the file name is needed.

But other key renaming are incorrect. For example:
KEY_AUDIO_FRAGMENT_TEST_PROFILE_ID is incorrect because you are mentioning the file name in the const name in which is not the convention suggested in the issue.
It should be renamed to:
INTERNAL_PROFILE_ID_EXTRA_KEY = "AudioFragmentTestActivity.internal_profile_id"

Ditto for other key changes.

@rt4914 rt4914 removed their assignment Feb 3, 2021
@rt4914
Copy link
Contributor

rt4914 commented Feb 6, 2021

@Luffy18346 Luffy18346 assigned rt4914 and unassigned janewaitara Feb 8, 2021
@rt4914
Copy link
Contributor

rt4914 commented Feb 23, 2021

Closing this now.

@rt4914 rt4914 closed this Feb 23, 2021
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.

None yet

3 participants