macos-ai-menubar-usage/AIMenubarUsageTests/ClaudeAuthTests.swift
Felipe M. 00c4e33171
Initial commit: AI Menubar Usage — macOS menu bar app for Cursor and Claude.
Includes provider integrations, settings, NSStatusItem UI, tests, Makefile, and README with screenshot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 20:41:40 +02:00

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)
}
}