Files
OSGKeyboard/OSGKeyboardTests/AssistantFieldActionTests.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

52 lines
1.3 KiB
Swift

@testable import OSGKeyboardShared
import XCTest
@MainActor
final class AssistantFieldActionTests: XCTestCase {
func testContentActionsRequireText() {
let roles: [KeyboardState.ReturnKeyRole] = [
.send,
.go,
.search,
.join,
.route,
.google,
.yahoo
]
for role in roles {
XCTAssertFalse(role.assistantActionAvailable(hasText: false))
XCTAssertTrue(role.assistantActionAvailable(hasText: true))
}
}
func testNavigationActionsRemainAvailableWithoutText() {
let roles: [KeyboardState.ReturnKeyRole] = [
.newline,
.done,
.next,
.continue,
.emergencyCall
]
for role in roles {
XCTAssertTrue(role.assistantActionAvailable(hasText: false))
}
}
func testSearchRolesUseSearchSymbol() {
XCTAssertEqual(
KeyboardState.ReturnKeyRole.search.assistantActionSystemImage,
"magnifyingglass"
)
XCTAssertEqual(
KeyboardState.ReturnKeyRole.google.assistantActionSystemImage,
"magnifyingglass"
)
XCTAssertEqual(
KeyboardState.ReturnKeyRole.yahoo.assistantActionSystemImage,
"magnifyingglass"
)
}
}