Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c42c39eb authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Resetting the state when targets are set and the interaction ends" into main

parents c0fccde1 d383e654
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -247,6 +247,19 @@ class MagneticNotificationRowManagerImplTest : SysuiTestCase() {
            assertThat(underTest.currentState).isEqualTo(State.IDLE)
        }

    @Test
    fun onMagneticInteractionEnd_whileTargetsSet_goesToIdle() =
        kosmos.testScope.runTest {
            // GIVEN that targets are set
            setTargets()

            // WHEN the interaction ends on the row
            underTest.onMagneticInteractionEnd(swipedRow, velocity = null)

            // THEN the state resets
            assertThat(underTest.currentState).isEqualTo(State.IDLE)
        }

    @Test
    fun onMagneticInteractionEnd_whileDetached_goesToIdle() =
        kosmos.testScope.runTest {
+1 −0
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ constructor(
        translationOffset = 0f
        if (row.isSwipedTarget()) {
            when (currentState) {
                State.TARGETS_SET -> currentState = State.IDLE
                State.PULLING -> {
                    snapNeighborsBack(velocity)
                    currentState = State.IDLE