mirror of
https://github.com/codybrom/blankie.git
synced 2026-05-14 07:40:35 +00:00
0d17ec9923
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
36 lines
802 B
Swift
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()
|
|
}
|
|
}
|