diff --git a/CHANGELOG.md b/CHANGELOG.md index 10460860c..31ef2cad9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - macOS menu: device list now shows connected nodes only. - iOS node: fix ReplayKit screen recording crash caused by queue isolation assertions during capture. - CLI: avoid spurious gateway close errors after successful request/response cycles. +- Tests: add Swift Testing coverage for camera errors and Kotest coverage for Android bridge endpoints. ## 2.0.0-beta4 — 2025-12-27 diff --git a/apps/android/app/build.gradle.kts b/apps/android/app/build.gradle.kts index c2f1cd817..1b353d83f 100644 --- a/apps/android/app/build.gradle.kts +++ b/apps/android/app/build.gradle.kts @@ -93,4 +93,11 @@ dependencies { testImplementation("junit:junit:4.13.2") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2") + testImplementation("io.kotest:kotest-runner-junit5-jvm:6.0.7") + testImplementation("io.kotest:kotest-assertions-core-jvm:6.0.7") + testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.13.3") +} + +tasks.withType().configureEach { + useJUnitPlatform() } diff --git a/apps/android/app/src/test/java/com/steipete/clawdis/node/bridge/BridgeEndpointKotestTest.kt b/apps/android/app/src/test/java/com/steipete/clawdis/node/bridge/BridgeEndpointKotestTest.kt new file mode 100644 index 000000000..5e1b09490 --- /dev/null +++ b/apps/android/app/src/test/java/com/steipete/clawdis/node/bridge/BridgeEndpointKotestTest.kt @@ -0,0 +1,14 @@ +package com.steipete.clawdis.node.bridge + +import io.kotest.core.spec.style.StringSpec +import io.kotest.matchers.shouldBe + +class BridgeEndpointKotestTest : StringSpec({ + "manual endpoint builds stable id + name" { + val endpoint = BridgeEndpoint.manual("10.0.0.5", 18790) + endpoint.stableId shouldBe "manual|10.0.0.5|18790" + endpoint.name shouldBe "10.0.0.5:18790" + endpoint.host shouldBe "10.0.0.5" + endpoint.port shouldBe 18790 + } +}) diff --git a/apps/ios/Tests/CameraControllerErrorTests.swift b/apps/ios/Tests/CameraControllerErrorTests.swift new file mode 100644 index 000000000..3b3c94281 --- /dev/null +++ b/apps/ios/Tests/CameraControllerErrorTests.swift @@ -0,0 +1,13 @@ +import Testing +@testable import Clawdis + +@Suite struct CameraControllerErrorTests { + @Test func errorDescriptionsAreStable() { + #expect(CameraController.CameraError.cameraUnavailable.errorDescription == "Camera unavailable") + #expect(CameraController.CameraError.microphoneUnavailable.errorDescription == "Microphone unavailable") + #expect(CameraController.CameraError.permissionDenied(kind: "Camera").errorDescription == "Camera permission denied") + #expect(CameraController.CameraError.invalidParams("bad").errorDescription == "bad") + #expect(CameraController.CameraError.captureFailed("nope").errorDescription == "nope") + #expect(CameraController.CameraError.exportFailed("export").errorDescription == "export") + } +}