package com.ponzischeme89.memby.ui

import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test

class QuickActionsNavigationTest {
    @Test
    fun `quick actions require an intentional hold`() {
        assertTrue(QuickActionsHoldDurationMillis >= 600L)
    }

    @Test
    fun `down reaches every action and stops at the final action`() {
        assertEquals(1, quickActionNextIndex(0, 4, QuickActionDirection.DOWN))
        assertEquals(3, quickActionNextIndex(3, 4, QuickActionDirection.DOWN))
    }

    @Test
    fun `up returns toward the safe first action and stops there`() {
        assertEquals(2, quickActionNextIndex(3, 4, QuickActionDirection.UP))
        assertEquals(0, quickActionNextIndex(0, 4, QuickActionDirection.UP))
    }

    @Test
    fun `empty menus remain bounded`() {
        assertEquals(0, quickActionNextIndex(5, 0, QuickActionDirection.DOWN))
    }
}
