diff --git a/apps/student/build.gradle b/apps/student/build.gradle index dbdfdf2d9c..19e4192c12 100644 --- a/apps/student/build.gradle +++ b/apps/student/build.gradle @@ -55,7 +55,7 @@ android { applicationId "com.instructure.candroid" minSdkVersion Versions.MIN_SDK targetSdkVersion Versions.TARGET_SDK - versionCode = 207 + versionCode = 208 versionName = '6.7.0' vectorDrawables.useSupportLibrary = true diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/renderTests/ConferenceDetailsRenderTest.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/renderTests/ConferenceDetailsRenderTest.kt index 2f95de1d4b..4006806a18 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/renderTests/ConferenceDetailsRenderTest.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/renderTests/ConferenceDetailsRenderTest.kt @@ -20,6 +20,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import com.instructure.canvasapi2.models.CanvasContext import com.instructure.canvasapi2.models.Conference import com.instructure.canvasapi2.models.Course +import com.instructure.canvasapi2.models.Group import com.instructure.student.espresso.StudentRenderTest import com.instructure.student.mobius.conferences.conference_details.ui.ConferenceDetailsFragment import com.instructure.student.mobius.conferences.conference_details.ui.ConferenceDetailsViewState @@ -32,6 +33,7 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class ConferenceDetailsRenderTest : StudentRenderTest() { private val canvasContext: CanvasContext = Course(id = 123L, name = "Test Course") + private val canvasContextGroup: CanvasContext = Group(id = 1337L, name = "Test Group") private lateinit var baseState: ConferenceDetailsViewState private lateinit var baseRecordingState: ConferenceRecordingViewState @@ -182,6 +184,16 @@ class ConferenceDetailsRenderTest : StudentRenderTest() { conferenceDetailsRenderPage.assertDisplaysRecording(recordingState) } + + @Test + fun displaysToolbarItemsWithGroup() { + val state = baseState + loadPageWithViewState(state, canvasContextGroup) + + conferenceDetailsRenderPage.assertDisplaysToolbarTitle("Conference Details") + conferenceDetailsRenderPage.assertDisplaysToolbarSubtitle(canvasContextGroup.name!!) + } + private fun loadPageWithViewState(state: ConferenceDetailsViewState, canvasContext: CanvasContext) { val emptyEffectRunner = object : WorkRunner { override fun dispose() = Unit diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/renderTests/ConferenceListRenderTest.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/renderTests/ConferenceListRenderTest.kt index a01a41b9d9..22d9f3efb2 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/renderTests/ConferenceListRenderTest.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/renderTests/ConferenceListRenderTest.kt @@ -20,6 +20,7 @@ import android.os.Build import androidx.test.ext.junit.runners.AndroidJUnit4 import com.instructure.canvasapi2.models.CanvasContext import com.instructure.canvasapi2.models.Course +import com.instructure.canvasapi2.models.Group import com.instructure.student.espresso.StudentRenderTest import com.instructure.student.mobius.conferences.conference_list.ui.ConferenceListFragment import com.instructure.student.mobius.conferences.conference_list.ui.ConferenceListItemViewState @@ -31,6 +32,7 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class ConferenceListRenderTest : StudentRenderTest() { private val canvasContext: CanvasContext = Course(id = 123L, name = "Test Course") + private val canvasContextGroup: CanvasContext = Group(id = 1337L, name = "Test Group") @Test fun displaysToolbarItems() { @@ -117,6 +119,16 @@ class ConferenceListRenderTest : StudentRenderTest() { conferenceListRenderPage.assertDisplaysListItems(itemStates) } + + @Test + fun displaysToolbarItemsWithGroup() { + val state = ConferenceListViewState.Loaded(isLaunchingInBrowser = false, itemStates = emptyList()) + loadPageWithViewState(state, canvasContextGroup) + conferenceListRenderPage.assertDisplaysToolbarTitle("Conferences") + conferenceListRenderPage.assertDisplaysToolbarSubtitle(canvasContextGroup.name!!) + conferenceListRenderPage.assertDisplaysLaunching(false) + } + private fun loadPageWithViewState(state: ConferenceListViewState, canvasContext: CanvasContext) { val emptyEffectRunner = object : WorkRunner { override fun dispose() = Unit diff --git a/apps/student/src/main/java/com/instructure/student/mobius/conferences/conference_details/ui/ConferenceDetailsFragment.kt b/apps/student/src/main/java/com/instructure/student/mobius/conferences/conference_details/ui/ConferenceDetailsFragment.kt index f3f0d79d0f..6b8ede369a 100644 --- a/apps/student/src/main/java/com/instructure/student/mobius/conferences/conference_details/ui/ConferenceDetailsFragment.kt +++ b/apps/student/src/main/java/com/instructure/student/mobius/conferences/conference_details/ui/ConferenceDetailsFragment.kt @@ -32,7 +32,7 @@ import com.instructure.student.mobius.conferences.conference_details.* class ConferenceDetailsFragment : MobiusFragment() { - val canvasContext by ParcelableArg(key = Const.CANVAS_CONTEXT) + val canvasContext by ParcelableArg(key = Const.CANVAS_CONTEXT) val conference by ParcelableArg(key = Const.CONFERENCE) diff --git a/apps/student/src/main/java/com/instructure/student/mobius/conferences/conference_list/ui/ConferenceListFragment.kt b/apps/student/src/main/java/com/instructure/student/mobius/conferences/conference_list/ui/ConferenceListFragment.kt index ddf06a43f0..c349f25389 100644 --- a/apps/student/src/main/java/com/instructure/student/mobius/conferences/conference_list/ui/ConferenceListFragment.kt +++ b/apps/student/src/main/java/com/instructure/student/mobius/conferences/conference_list/ui/ConferenceListFragment.kt @@ -36,7 +36,7 @@ import com.instructure.student.mobius.conferences.conference_list.ConferenceList class ConferenceListFragment : MobiusFragment() { - val canvasContext by ParcelableArg(key = Const.CANVAS_CONTEXT) + val canvasContext by ParcelableArg(key = Const.CANVAS_CONTEXT) override fun makeUpdate() = ConferenceListUpdate()