Includes provider integrations, settings, NSStatusItem UI, tests, Makefile, and README with screenshot. Co-authored-by: Cursor <cursoragent@cursor.com>
20 lines
711 B
Swift
20 lines
711 B
Swift
import XCTest
|
|
@testable import AIMenubarUsage
|
|
|
|
final class ClaudeAuthTests: XCTestCase {
|
|
func testParseOAuthJSONFromManualPayload() throws {
|
|
let json: [String: Any] = [
|
|
"claudeAiOauth": [
|
|
"accessToken": "sk-ant-oat01-test",
|
|
"refreshToken": "sk-ant-ort01-test",
|
|
"expiresAt": 4_000_000_000_000.0,
|
|
"subscriptionType": "max",
|
|
],
|
|
]
|
|
|
|
let credentials = try ClaudeAuthService.parseOAuthJSON(json, source: .manual)
|
|
XCTAssertEqual(credentials.accessToken, "sk-ant-oat01-test")
|
|
XCTAssertEqual(credentials.subscriptionType, "max")
|
|
XCTAssertEqual(credentials.source, .manual)
|
|
}
|
|
}
|