From 10c2e8f2dda2902eee8dd197bde14a5e9d048eb1 Mon Sep 17 00:00:00 2001 From: Saptak Manna Date: Wed, 3 Jul 2024 17:44:43 +0530 Subject: [PATCH] Fix ktlint checks --- .../android/app/home/RouteToTopicListener.kt | 2 +- .../android/app/topic/TopicFragmentTest.kt | 8 ++- .../topic/lessons/TopicLessonsFragmentTest.kt | 70 ++++++++++++------- 3 files changed, 52 insertions(+), 28 deletions(-) diff --git a/app/src/main/java/org/oppia/android/app/home/RouteToTopicListener.kt b/app/src/main/java/org/oppia/android/app/home/RouteToTopicListener.kt index 5e50031cd95..c00a7dc8389 100755 --- a/app/src/main/java/org/oppia/android/app/home/RouteToTopicListener.kt +++ b/app/src/main/java/org/oppia/android/app/home/RouteToTopicListener.kt @@ -2,5 +2,5 @@ package org.oppia.android.app.home /** Listener for when an activity should route to a topic. */ interface RouteToTopicListener { - fun routeToTopic(internalProfileId: Int, classroomId: String, topicId: String) + fun routeToTopic(internalProfileId: Int, classroomId: String, topicId: String) } diff --git a/app/src/sharedTest/java/org/oppia/android/app/topic/TopicFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/topic/TopicFragmentTest.kt index c8483d9992a..dc00a9ca748 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/topic/TopicFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/topic/TopicFragmentTest.kt @@ -218,9 +218,11 @@ class TopicFragmentTest { onView(withId(R.id.close_spotlight_button)).perform(click()) } - launch(createTopicActivityIntent( - internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID - )).use { + launch( + createTopicActivityIntent( + internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID + ) + ).use { testCoroutineDispatchers.runCurrent() onView(withText(R.string.topic_lessons_tab_spotlight_hint)).check(doesNotExist()) } diff --git a/app/src/sharedTest/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentTest.kt index 95f9243959e..39f9fff33c4 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentTest.kt @@ -234,9 +234,11 @@ class TopicLessonsFragmentTest { profileId, timestampOlderThanOneWeek = false ) - launch(createTopicActivityIntent( - internalProfileId, TEST_CLASSROOM_ID_1, RATIOS_TOPIC_ID - )).use { + launch( + createTopicActivityIntent( + internalProfileId, TEST_CLASSROOM_ID_1, RATIOS_TOPIC_ID + ) + ).use { clickLessonTab() verifyTextOnStorySummaryListItemAtPosition(itemPosition = 1, stringToMatch = "100%") } @@ -705,8 +707,10 @@ class TopicLessonsFragmentTest { version = FRACTIONS_STORY_0_EXPLORATION_0_CURRENT_VERSION, ) testCoroutineDispatchers.runCurrent() - launch(createTopicActivityIntent( - internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID) + launch( + createTopicActivityIntent( + internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID + ) ).use { clickLessonTab() clickStoryItem(position = 1, targetViewId = R.id.chapter_list_drop_down_icon) @@ -759,8 +763,10 @@ class TopicLessonsFragmentTest { profileId = profileId, version = 1 // Old version, but it doesn't matter since the new version is incompatible. ) - launch(createTopicActivityIntent( - internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID) + launch( + createTopicActivityIntent( + internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID + ) ).use { clickLessonTab() clickStoryItem(position = 1, targetViewId = R.id.chapter_list_drop_down_icon) @@ -795,8 +801,10 @@ class TopicLessonsFragmentTest { @Test fun testLessonsPlayFragment_loadFractionsTopic_clickChap_chapterMarkedAsNotStarted_opensExpAct() { - launch(createTopicActivityIntent( - internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID) + launch( + createTopicActivityIntent( + internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID + ) ).use { clickLessonTab() clickStoryItem(position = 1, targetViewId = R.id.chapter_list_drop_down_icon) @@ -836,8 +844,10 @@ class TopicLessonsFragmentTest { profileId = profileId, timestampOlderThanOneWeek = false ) - launch(createTopicActivityIntent( - internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID) + launch( + createTopicActivityIntent( + internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID + ) ).use { clickLessonTab() clickStoryItem(position = 1, targetViewId = R.id.chapter_list_drop_down_icon) @@ -877,8 +887,10 @@ class TopicLessonsFragmentTest { profileId = profileId, timestampOlderThanOneWeek = false ) - launch(createTopicActivityIntent( - internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID) + launch( + createTopicActivityIntent( + internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID + ) ).use { clickLessonTab() clickStoryItem(position = 1, targetViewId = R.id.chapter_list_drop_down_icon) @@ -1025,9 +1037,11 @@ class TopicLessonsFragmentTest { profileId, timestampOlderThanOneWeek = false ) - launch(createTopicActivityIntent( - internalProfileId, TEST_CLASSROOM_ID_1, RATIOS_TOPIC_ID - )).use { + launch( + createTopicActivityIntent( + internalProfileId, TEST_CLASSROOM_ID_1, RATIOS_TOPIC_ID + ) + ).use { clickLessonTab() clickStoryItem(position = 1, targetViewId = R.id.chapter_list_drop_down_icon) scrollToPosition(position = 1) @@ -1106,8 +1120,10 @@ class TopicLessonsFragmentTest { @Test fun testLessonsPlayFragment_loadRatiosTopic_checkDropDownIconWithScreenReader_isClickable() { - launch(createTopicActivityIntent( - internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID) + launch( + createTopicActivityIntent( + internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID + ) ).use { fakeAccessibilityService.setScreenReaderEnabled(true) clickLessonTab() @@ -1126,8 +1142,10 @@ class TopicLessonsFragmentTest { @Test fun testLessonPlayFragment_loadRatiosTopic_checkDropDownIconWithoutScreenReader_isNotClickable() { - launch(createTopicActivityIntent( - internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID) + launch( + createTopicActivityIntent( + internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID + ) ).use { clickLessonTab() testCoroutineDispatchers.runCurrent() @@ -1145,8 +1163,10 @@ class TopicLessonsFragmentTest { @Test fun testLessonPlayFragment_loadRatiosTopic_checkStoryContainerWithScreenReader_isNotClickable() { - launch(createTopicActivityIntent( - internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID) + launch( + createTopicActivityIntent( + internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID + ) ).use { fakeAccessibilityService.setScreenReaderEnabled(true) clickLessonTab() @@ -1165,8 +1185,10 @@ class TopicLessonsFragmentTest { @Test fun testLessonPlayFragment_loadRatiosTopic_checkStoryContainerWithoutScreenReader_isClickable() { - launch(createTopicActivityIntent( - internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID) + launch( + createTopicActivityIntent( + internalProfileId, TEST_CLASSROOM_ID_1, FRACTIONS_TOPIC_ID + ) ).use { clickLessonTab() testCoroutineDispatchers.runCurrent()