test(ios): cover context erasure and native capability restrictions

Add Apple-platform tests without presenting them as Linux results. Improve native dark-mode contrast and keep the portable policy suite separate from WebKit tests. Swift formatting and syntax checks pass; Xcode execution remains required.
This commit is contained in:
Yuvomi Mobile Contributors committed 2026-10-21 07:18:42 +02:00
1 parent 69c48169e2
commit f776c853c6
4 files changed
+36 -3

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
import WebKit
import XCTest
@testable import Yuvomi
final class BrowserModelTests: XCTestCase {
@MainActor
func testMainViewHasNoNativeBridgeOrAutomaticPopupAccess() {
let model = BrowserModel()
XCTAssertFalse(model.web.configuration.preferences.javaScriptCanOpenWindowsAutomatically)
XCTAssertTrue(model.web.configuration.userContentController.userScripts.isEmpty)
XCTAssertTrue(model.web.configuration.websiteDataStore.isPersistent)
XCTAssertFalse(model.web.isInspectable)
}
@MainActor
func testServerErasureReplacesHistoryContext() async {
let model = BrowserModel()
let previousView = model.web
await withCheckedContinuation { continuation in
model.erase { continuation.resume() }
}
XCTAssertFalse(previousView === model.web)
XCTAssertNil(model.server)
XCTAssertFalse(model.canGoBack)
XCTAssertNil(model.error)
}
}