test(ios): cover ScreenController webview setup

This commit is contained in:
Peter Steinberger
2025-12-14 05:42:19 +00:00
parent 1ff7d458a5
commit 7510a6f66a

View File

@@ -0,0 +1,28 @@
import Testing
import WebKit
@testable import Clawdis
@Suite struct ScreenControllerTests {
@Test @MainActor func canvasModeConfiguresWebViewForTouch() {
let screen = ScreenController()
#expect(screen.mode == .canvas)
#expect(screen.webView.isOpaque == false)
#expect(screen.webView.backgroundColor == .clear)
let scrollView = screen.webView.scrollView
#expect(scrollView.backgroundColor == .clear)
#expect(scrollView.contentInsetAdjustmentBehavior == .never)
#expect(scrollView.isScrollEnabled == false)
#expect(scrollView.bounces == false)
}
@Test @MainActor func webModeRejectsInvalidURLStrings() {
let screen = ScreenController()
screen.navigate(to: " \n")
screen.setMode(.web)
#expect(screen.mode == .web)
}
}