package com.ponzischeme89.memby.ui

import kotlin.random.Random
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test

class WelcomeQuotesTest {
    @Test
    fun `unknown styles safely fall back to neutral`() {
        assertEquals(
            randomWelcomeQuote("neutral", Random(7)),
            randomWelcomeQuote("something-new", Random(7)),
        )
    }

    @Test
    fun `each style supplies a welcome line`() {
        WelcomeQuoteStyle.entries.forEach { style ->
            assertTrue(randomWelcomeQuote(style.value, Random(3)).isNotBlank())
        }
    }

    @Test
    fun `login greeting trims the authenticated username`() {
        assertTrue(
            loginWelcomeMessage("  Matt  ", "positive", Random(1))
                .startsWith("Welcome to Memby, Matt. "),
        )
    }
}
