Fix 8 audit items: remove force-unwraps, improve accessibility and concurrency
- Replace force-unwrap HK types with modern HKQuantityType(_:) initializer - Replace Calendar.date force-unwraps with guard/let in HealthService, HeaderPercView, MoodStreakActivity, DayViewViewModel, MonthTotalTemplate - Extract DayViewViewModel.countEntries into testable static method with safe flatMap - Replace DispatchQueue.main.asyncAfter with Task.sleep in CelebrationAnimations - Add .minimumScaleFactor(0.5) to SmallRollUpHeaderView for Dynamic Type - Add VoiceOver accessibility labels to HeaderPercView mood percentages - Fix @testable import iFeel → Feels in Tests_iOS.swift - Add 4 unit tests for countEntries (TDD) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
import XCTest
|
||||
@testable import iFeel
|
||||
@testable import Feels
|
||||
|
||||
class Tests_iOS: XCTestCase {
|
||||
override func setUpWithError() throws {
|
||||
@@ -49,9 +49,10 @@ class Tests_iOS: XCTestCase {
|
||||
// let fakeOnboarding = OnboardingData()
|
||||
// fakeOnboarding.inputDay = DayOptions.Today
|
||||
// fakeOnboarding.date = todayOneHourAhead
|
||||
//
|
||||
//
|
||||
// let lastDay = ShowBasedOnVoteLogics.getLastDateVoteShouldExist(onboardingData: fakeOnboarding)
|
||||
// let yesterday = Calendar.current.date(byAdding: .day, value: -1, to: Date())!
|
||||
// XCTAssertTrue(lastDay == yesterday)
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user