41 lines
1.2 KiB
Swift
41 lines
1.2 KiB
Swift
//
|
|
// leanring_buddyTests.swift
|
|
// leanring-buddyTests
|
|
//
|
|
// Created by thorfinn on 3/2/26.
|
|
//
|
|
|
|
import Testing
|
|
@testable import leanring_buddy
|
|
|
|
struct leanring_buddyTests {
|
|
|
|
@Test func firstPermissionRequestUsesSystemPromptOnly() async throws {
|
|
let presentationDestination = WindowPositionManager.permissionRequestPresentationDestination(
|
|
hasPermissionNow: false,
|
|
hasAttemptedSystemPrompt: false
|
|
)
|
|
|
|
#expect(presentationDestination == .systemPrompt)
|
|
}
|
|
|
|
@Test func repeatedPermissionRequestOpensSystemSettings() async throws {
|
|
let presentationDestination = WindowPositionManager.permissionRequestPresentationDestination(
|
|
hasPermissionNow: false,
|
|
hasAttemptedSystemPrompt: true
|
|
)
|
|
|
|
#expect(presentationDestination == .systemSettings)
|
|
}
|
|
|
|
@Test func knownGrantedScreenRecordingPermissionSkipsTheGate() async throws {
|
|
let shouldTreatPermissionAsGranted = WindowPositionManager.shouldTreatScreenRecordingPermissionAsGrantedForSessionLaunch(
|
|
hasScreenRecordingPermissionNow: false,
|
|
hasPreviouslyConfirmedScreenRecordingPermission: true
|
|
)
|
|
|
|
#expect(shouldTreatPermissionAsGranted)
|
|
}
|
|
|
|
}
|