diff --git a/Backpack-SwiftUI/Tests/Calendar/BPKCalendarTests.swift b/Backpack-SwiftUI/Tests/Calendar/BPKCalendarTests.swift index b402f4a3b..96fa7e06f 100644 --- a/Backpack-SwiftUI/Tests/Calendar/BPKCalendarTests.swift +++ b/Backpack-SwiftUI/Tests/Calendar/BPKCalendarTests.swift @@ -46,7 +46,8 @@ class BPKCalendarTests: XCTestCase { ) ), calendar: Calendar.current, - validRange: validStart...validEnd + validRange: validStart...validEnd, + calendarAccessibilityConfiguration: .mock ) .frame(width: 320, height: 720) ) @@ -63,7 +64,8 @@ class BPKCalendarTests: XCTestCase { accessibilityConfigurations: rangeAccessibilityConfig ), calendar: Calendar.current, - validRange: validStart...validEnd + validRange: validStart...validEnd, + calendarAccessibilityConfiguration: .mock ) .frame(width: 320, height: 720) ) @@ -80,7 +82,8 @@ class BPKCalendarTests: XCTestCase { accessibilityConfigurations: rangeAccessibilityConfig ), calendar: Calendar.current, - validRange: validStart...validEnd + validRange: validStart...validEnd, + calendarAccessibilityConfiguration: .mock ) .frame(width: 320, height: 720) ) @@ -98,6 +101,7 @@ class BPKCalendarTests: XCTestCase { ), calendar: Calendar.current, validRange: validStart...validEnd, + calendarAccessibilityConfiguration: .mock, dayAccessoryView: { _ in BPKIconView(.search, size: .small) .foregroundColor(.accentColor) @@ -118,7 +122,8 @@ class BPKCalendarTests: XCTestCase { accessibilityConfigurations: rangeAccessibilityConfig ), calendar: Calendar.current, - validRange: validStart...validEnd + validRange: validStart...validEnd, + calendarAccessibilityConfiguration: .mock ) .frame(width: 320, height: 720) ) @@ -141,3 +146,28 @@ class BPKCalendarTests: XCTestCase { ) } } + +extension CalendarAccessibilityConfiguration { + static var mock: CalendarAccessibilityConfiguration { + return CalendarAccessibilityConfiguration( + singleSelection: .init( + accessibilityConfigurations: .init( + selectionHint: "hint" + ), + dateFormatter: DateFormatter() + ), + rangeSelection: .init( + accessibilityConfigurations: .init( + startSelectionHint: "startSelectionHint", + endSelectionHint: "endSelectionHint", + startSelectionState: "startSelectionState", + endSelectionState: "endSelectionState", + betweenSelectionState: "betweenSelectionState", + startAndEndSelectionState: "startAndEndSelectionState", + returnDatePrompt: "returnDatePrompt" + ), + dateFormatter: DateFormatter() + ) + ) + } +}