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 #141 & Fix #1392: Update topic description #1395

Merged
merged 5 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,7 @@ class TopicInfoFragmentPresenter @Inject constructor(
fragment,
Observer<Topic> { topic ->
topicInfoViewModel.topic.set(topic)
topicInfoViewModel.topicDescription.set(
htmlParser.parseOppiaHtml(
topic.description,
fragment.requireView().findViewById(R.id.topic_description_text_view)
)
)
topicInfoViewModel.topicDescription.set(topic.description)
rt4914 marked this conversation as resolved.
Show resolved Hide resolved
topicInfoViewModel.calculateTopicSizeWithUnit()
controlSeeMoreTextVisibility()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.oppia.app.topic.info

import android.text.SpannedString
import android.text.style.StyleSpan
import android.view.View
import android.widget.TextView
import androidx.test.core.app.ActivityScenario
Expand All @@ -19,7 +17,6 @@ import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.google.common.truth.Truth.assertThat
import com.google.firebase.FirebaseApp
import org.hamcrest.CoreMatchers
import org.hamcrest.Description
Expand Down Expand Up @@ -86,22 +83,6 @@ class TopicInfoFragmentTest {
}
}

anandwana001 marked this conversation as resolved.
Show resolved Hide resolved
@Test
fun testTopicInfoFragment_loadFragmentWithTestTopicId1_checkTopicDescription_hasRichText() {
launchTopicActivityIntent(internalProfileId, TEST_TOPIC_ID).use { scenario ->
scenario.onActivity { activity ->
val descriptionTextView: TextView = activity.findViewById(R.id.topic_description_text_view)
val descriptionText = descriptionTextView.text as SpannedString
val spans = descriptionText.getSpans(
0,
descriptionText.length,
StyleSpan::class.java
)
assertThat(spans).isNotEmpty()
}
}
}

@Test
fun testTopicInfoFragment_loadFragment_configurationChange_checkTopicThumbnail_isCorrect() {
launchTopicActivityIntent(internalProfileId, TEST_TOPIC_ID).use {
Expand Down
2 changes: 1 addition & 1 deletion domain/src/main/assets/fractions_topic.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"topic": {
"story_reference_schema_version": 1,
"description": "You'll often need to talk about <b>part</b> of an object or group. For example, a jar of milk might be half-full, or some of the eggs in a box might have broken. In these lessons, you'll learn to use <b>fractions</b> to describe situations like these.",
"description": "You'll often need to talk about part of an object or group. For example, a jar of milk might be half-full, or some of the eggs in a box might have broken. In these lessons, you'll learn to use fractions to describe situations like these.",
"canonical_story_references": [
{
"story_id": "wANbh4oOClga",
Expand Down