Skip to content

Commit

Permalink
Fix #2820: Add label for FAQSingleActivity (#2926)
Browse files Browse the repository at this point in the history
* Fix #2820: Add label for FAQSingleActivity

* changed name to camel case

* renamed faq string
  • Loading branch information
yashraj-01 authored Mar 18, 2021
1 parent e94dbe0 commit dd2ff0f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
<activity
android:name=".app.help.faq.FAQListActivity"
android:theme="@style/OppiaThemeWithoutActionBar"
android:label="@string/faq_activity_label" />
android:label="@string/faq_activity_title" />
<activity
android:name=".app.help.faq.faqsingle.FAQSingleActivity"
android:label="@string/faq_activity_title"
android:theme="@style/OppiaThemeWithoutActionBar" />
<activity
android:name=".app.help.HelpActivity"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<string name="FAQs">FAQs</string>
<string name="featured_questions">Featured Questions</string>
<string name="frequently_asked_questions">Frequently Asked Questions</string>
<string name="faq_activity_label">FAQs (Frequently Asked Questions)</string>
<string name="faq_activity_title">FAQs (Frequently Asked Questions)</string>
<string name="frequently_asked_questions_FAQ">Frequently Asked Questions (FAQs)</string>
<string name="info">Info</string>
<string name="lessons">Lessons</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ class FAQSingleActivityTest {
FAQSingleActivity::class.java, /* initialTouchMode= */ true, /* launchActivity= */ false
)

@Inject
lateinit var context: Context

@Before
fun setUp() {
setUpTestApplicationComponent()
Expand All @@ -104,6 +107,15 @@ class FAQSingleActivityTest {
Intents.release()
}

@Test
fun testFaqSingleActivity_hasCorrectActivityLabel() {
val title = activityTestRule.activity.title

// 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_title))
}

@Test
fun openFAQSingleActivity_checkQuestion_isDisplayed() {
launch<FAQSingleActivity>(createFAQSingleActivity()).use {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class FaqListActivityTest {

// 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))
assertThat(title).isEqualTo(context.getString(R.string.faq_activity_title))
}

private fun setUpTestApplicationComponent() {
Expand Down

0 comments on commit dd2ff0f

Please sign in to comment.