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 #2633: Add label for FAQList screen #2750

Merged
merged 7 commits into from
Feb 25, 2021
Merged

Fix #2633: Add label for FAQList screen #2750

merged 7 commits into from
Feb 25, 2021

Conversation

Sparsh1212
Copy link
Contributor

Explanation

Fixes #2633: Add label for FAQList screen for correct talkback output.

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.

@Sparsh1212
Copy link
Contributor Author

@rt4914 @BenHenning PTAL

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.

PTAL. Thanks.

@rt4914 rt4914 assigned Sparsh1212 and unassigned rt4914 Feb 23, 2021
@BenHenning BenHenning added the PR don't merge - NEEDS UPDATE Corresponds to PRs that need to be updated with the latest develop changes before they can be merged label Feb 24, 2021
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @Sparsh1212! Left some thoughts.

@BenHenning BenHenning removed their assignment Feb 24, 2021
@BenHenning BenHenning removed the PR don't merge - NEEDS UPDATE Corresponds to PRs that need to be updated with the latest develop changes before they can be merged label Feb 24, 2021
@Sparsh1212
Copy link
Contributor Author

@rt4914 @BenHenning PTAL, Thanks.

@rt4914 rt4914 assigned rt4914 and BenHenning and unassigned Sparsh1212 Feb 24, 2021
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @Sparsh1212! LGTM.


// Verify that the activity label is correct as a proxy to verify TalkBack will announce the
// correct string when it's read out.
assertThat(title).isEqualTo(context.getString(R.string.faq_activity_label))
Copy link
Member

Choose a reason for hiding this comment

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

@rt4914 random thought: given we keep repeating this context in a bunch of places, could we maybe introduce an extension method to contextualize this? E.g. introducing a flow that would let us do:

assertThat(activityTestRule.activity).hasTalkBackLabel(R.string.faq_activity_label)

I was thinking at first that we could maybe do this with an extension function, but I actually think we will need to implement a custom subject (https://truth.dev/extension.html) since unfortunately AndroidX doesn't include one for Activity (https://developer.android.com/training/testing/fundamentals#assertions). This might lead to other nice wins when testing activities, and we could establish other extensions as we need them. Might be worth filing an issue to track. @anandwana001 as well since this falls under testing.

Note that I do not suggest doing any of this work in this PR--let's keep the current pattern & consider doing the above.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. @anandwana001 Can you file an issue for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

@BenHenning is Custome Subject is available in Kotlin?
Reference - google/truth#536

I just had a quick look over what a custom subject is and tried this gist, could you check once if it is the correct way?
https://gist.github.com/anandwana001/9bccce1f9a0413af5f86ec12dc331d24

I will look into more on this today and see how to have a clean implementation.

Copy link
Member

Choose a reason for hiding this comment

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

Custom subjects should work fine in Kotlin. Did you observe something that suggests they won’t?

Copy link
Member

Choose a reason for hiding this comment

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

(From what I can tell the issue you linked to is for using extensions which is actually why I was thinking custom subjects originally).

@BenHenning BenHenning removed their assignment Feb 25, 2021
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.

LGTM, thanks.

@rt4914 rt4914 merged commit 161401f into oppia:develop Feb 25, 2021
@Sparsh1212 Sparsh1212 deleted the a11y-faq-list branch February 25, 2021 11:09
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.

[A11y] FAQ List
4 participants