From 5620562f6ac8cbca87b24ae4e1378a7df3367cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Lo=CC=81pez=20Man=CC=83as?= Date: Wed, 16 Aug 2023 16:41:21 +0200 Subject: [PATCH] fix: fixed failing test swipping on the map --- .../maps/android/compose/MapInColumnTests.kt | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/app/src/androidTest/java/com/google/maps/android/compose/MapInColumnTests.kt b/app/src/androidTest/java/com/google/maps/android/compose/MapInColumnTests.kt index dac2a09c..5e418675 100644 --- a/app/src/androidTest/java/com/google/maps/android/compose/MapInColumnTests.kt +++ b/app/src/androidTest/java/com/google/maps/android/compose/MapInColumnTests.kt @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -130,18 +130,17 @@ class MapInColumnTests { startingPosition.assertEquals(cameraPositionState.position.target) } -// @Test -// fun testPanMapUp_MapCameraChangesColumnDoesNotScroll() { -// initMap() -// // Swipe the map up -// // FIXME - for some reason this scrolls the entire column instead of just the map -// composeTestRule.onNodeWithTag("Map").performTouchInput { swipeUp() } -// composeTestRule.waitForIdle() -// -// // Make sure that the map changed (i.e., we can scroll the map in the column) -// startingPosition.assertNotEquals(cameraPositionState.position.target) -// -// // Check to make sure column didn't scroll -// composeTestRule.onNodeWithTag("Item 1").assertIsDisplayed() -// } + @Test + fun testPanMapUp_MapCameraChangesColumnDoesNotScroll() { + initMap() + //Swipe the map up + composeTestRule.onNodeWithTag("Map").performTouchInput { swipeUp() } + composeTestRule.waitForIdle() + + //Make sure that the map changed (i.e., we can scroll the map in the column) + assertNotEquals(startingPosition, cameraPositionState.position.target) + + //Check to make sure column didn't scroll + composeTestRule.onNodeWithTag("Item 1").assertIsDisplayed() + } }