Files
OSGKeyboard/OSGKeyboardTests/HostAppURLRegistryTests.swift
Rocky 498f407585 feat(account): add managed credits and cloud gateway
Introduce optional Apple account-backed credits with scoped gateway access while preserving local and BYOK paths. Refresh assistant behavior, tests, privacy disclosures, docs, and the website for the 2.0 experience.
2026-08-20 11:43:21 +08:00

29 lines
932 B
Swift

// HostAppURLRegistryTests.swift
// OSGKeyboardTests
@testable import OSGKeyboardShared
import XCTest
final class HostAppURLRegistryTests: XCTestCase {
func testWeChatLookup() {
let entry = HostAppURLRegistry.lookup(bundleId: "com.tencent.xin")
XCTAssertEqual(entry?.returnURLString, "weixin://")
XCTAssertEqual(entry?.displayNameKey, "hostApp.wechat")
}
func testUnknownBundleReturnsNil() {
XCTAssertNil(HostAppURLRegistry.lookup(bundleId: "com.apple.MobileSMS"))
XCTAssertNil(HostAppURLRegistry.lookup(bundleId: nil))
XCTAssertNil(HostAppURLRegistry.lookup(bundleId: ""))
}
func testQuerySchemesIncludesWeChat() {
XCTAssertTrue(HostAppURLRegistry.querySchemes.contains("weixin"))
}
func testEntriesHaveUniqueBundleIds() {
let ids = HostAppURLRegistry.entries.map(\.bundleId)
XCTAssertEqual(Set(ids).count, ids.count)
}
}