Files
Cody Bromley 0d17ec9923 feat(tests): Add unit tests for AudioManager, PresetManager, and Sound classes
feat(tests): Implement async XCTestCase extension for handling asynchronous operations
feat(audio): Enhance Sound class with public access and loadSound method
feat(settings): Update GlobalSettings methods to use @MainActor for thread safety
2025-01-10 22:32:32 -06:00

36 lines
802 B
Swift

//
// BlankieTests.swift
// BlankieTests
//
// Created by Cody Bromley on 1/10/25.
//
import XCTest
@testable import Blankie
class BlankieTests: XCTestCase {
override func tearDown() async throws {
// Reset global state
await MainActor.run {
// Reset global settings
GlobalSettings.shared.setVolume(1.0)
GlobalSettings.shared.setAccentColor(nil)
GlobalSettings.shared.setAppearance(.system)
GlobalSettings.shared.setAlwaysStartPaused(true)
// Reset audio manager
AudioManager.shared.resetSounds()
}
// Delete non-default presets
await MainActor.run {
for preset in PresetManager.shared.presets.filter({ !$0.isDefault }) {
PresetManager.shared.deletePreset(preset)
}
}
try await super.tearDown()
}
}