Skip to content

Commit

Permalink
Add test for default screen resolution in Subject
Browse files Browse the repository at this point in the history
  • Loading branch information
matus-tomlein committed Jan 27, 2024
1 parent 9bdcc7b commit 9d194b4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import androidx.test.platform.app.InstrumentationRegistry
import com.snowplowanalytics.core.tracker.Logger.updateLogLevel
import com.snowplowanalytics.core.tracker.Subject
import com.snowplowanalytics.snowplow.Snowplow.createTracker
import com.snowplowanalytics.snowplow.network.HttpMethod
import com.snowplowanalytics.snowplow.util.Size
import org.junit.Assert
import org.junit.Test
Expand Down Expand Up @@ -131,6 +130,14 @@ class SubjectTest {
Assert.assertNull(subject.getSubject(true)["ip"])
}

@Test
fun testSetsScreenResolutionAutomaticaly() {
val subject = createSubject()
Assert.assertNotNull(subject.screenResolution)
Assert.assertTrue((subject.screenResolution?.width ?: 0) > 0)
Assert.assertTrue((subject.screenResolution?.height ?: 0) > 0)
}

// Helper Methods
private fun createSubject(): Subject {
updateLogLevel(LogLevel.DEBUG)
Expand Down

0 comments on commit 9d194b4

Please sign in to comment.