package com.example.smarthome

import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.compose.ui.unit.Density
import com.example.smarthome.ui.ControlPanel
import org.junit.Rule
import org.junit.Test

class UiAdaptationTest {
    @get:Rule
    val rule = createAndroidComposeRule<MainActivity>()

    @Test
    fun dpiAdaptation160to640() {
        listOf(160f, 240f, 320f, 480f, 640f).forEach { dpi ->
            rule.setContent {
                CompositionLocalProvider(LocalDensity provides Density(dpi / 160f)) {
                    ControlPanel(roomIndex = 0)
                }
            }
        }
    }
}
