498f407585
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.
52 lines
1.3 KiB
Swift
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"
|
|
)
|
|
}
|
|
}
|