@@ -7,15 +7,15 @@ import XCTest
7
7
8
8
@Test func testDefaultConfiguration( ) {
9
9
let config = StaggerConfiguration ( )
10
-
10
+
11
11
#expect( config. baseDelay == 0.1 )
12
12
// Check animation curve type without direct comparison
13
13
if case . default = config. animationCurve {
14
14
// This is correct
15
15
} else {
16
16
XCTFail ( " Expected default animation curve " )
17
17
}
18
-
18
+
19
19
// Check calculation strategy type without direct comparison
20
20
if case . priorityThenPosition( let direction) = config. calculationStrategy {
21
21
if case . leftToRight = direction {
@@ -34,9 +34,9 @@ import XCTest
34
34
animationCurve: . spring( response: 0.4 , dampingFraction: 0.7 ) ,
35
35
calculationStrategy: . positionOnly( . topToBottom)
36
36
)
37
-
37
+
38
38
#expect( config. baseDelay == 0.2 )
39
-
39
+
40
40
// Check calculation strategy
41
41
if case . positionOnly( let direction) = config. calculationStrategy {
42
42
if case . topToBottom = direction {
@@ -47,7 +47,7 @@ import XCTest
47
47
} else {
48
48
XCTFail ( " Expected positionOnly strategy " )
49
49
}
50
-
50
+
51
51
// Check animation curve
52
52
if case . spring( let response, let dampingFraction) = config. animationCurve {
53
53
#expect( response == 0.4 )
@@ -61,7 +61,7 @@ import XCTest
61
61
62
62
@Test func testAnimationCurveDefault( ) {
63
63
let curve = StaggerConfiguration . AnimationCurve. default
64
-
64
+
65
65
if case . default = curve {
66
66
// This is correct
67
67
} else {
@@ -71,7 +71,7 @@ import XCTest
71
71
72
72
@Test func testAnimationCurveEaseIn( ) {
73
73
let curve = StaggerConfiguration . AnimationCurve. easeIn
74
-
74
+
75
75
if case . easeIn = curve {
76
76
// This is correct
77
77
} else {
@@ -81,7 +81,7 @@ import XCTest
81
81
82
82
@Test func testAnimationCurveEaseOut( ) {
83
83
let curve = StaggerConfiguration . AnimationCurve. easeOut
84
-
84
+
85
85
if case . easeOut = curve {
86
86
// This is correct
87
87
} else {
@@ -91,7 +91,7 @@ import XCTest
91
91
92
92
@Test func testAnimationCurveEaseInOut( ) {
93
93
let curve = StaggerConfiguration . AnimationCurve. easeInOut
94
-
94
+
95
95
if case . easeInOut = curve {
96
96
// This is correct
97
97
} else {
@@ -103,7 +103,7 @@ import XCTest
103
103
let response = 0.6
104
104
let dampingFraction = 0.8
105
105
let curve = StaggerConfiguration . AnimationCurve. spring ( response: response, dampingFraction: dampingFraction)
106
-
106
+
107
107
if case . spring( let resultResponse, let resultDampingFraction) = curve {
108
108
#expect( resultResponse == response)
109
109
#expect( resultDampingFraction == dampingFraction)
@@ -115,7 +115,7 @@ import XCTest
115
115
@Test func testAnimationCurveCustom( ) {
116
116
let customAnimation = Animation . linear ( duration: 0.5 )
117
117
let curve = StaggerConfiguration . AnimationCurve. custom ( customAnimation)
118
-
118
+
119
119
if case . custom = curve {
120
120
// This is correct
121
121
} else {
@@ -127,7 +127,7 @@ import XCTest
127
127
128
128
@Test func testCalculationStrategyDefault( ) {
129
129
let strategy = StaggerConfiguration . CalculationStrategy. default
130
-
130
+
131
131
if case . priorityThenPosition( let direction) = strategy {
132
132
if case . leftToRight = direction {
133
133
// This is correct
@@ -148,27 +148,27 @@ import XCTest
148
148
. topToBottom,
149
149
. bottomToTop
150
150
]
151
-
151
+
152
152
#expect( directions. count == 4 )
153
153
}
154
154
155
155
// MARK: - Environment Values Tests
156
156
157
157
@Test func testEnvironmentValuesDefaults( ) {
158
158
let values = EnvironmentValues ( )
159
-
159
+
160
160
#expect( values. delays. isEmpty)
161
-
161
+
162
162
let defaultConfig = values. configuration
163
163
#expect( defaultConfig. baseDelay == 0.1 )
164
-
164
+
165
165
// Check animation curve type
166
166
if case . default = defaultConfig. animationCurve {
167
167
// This is correct
168
168
} else {
169
169
XCTFail ( " Expected default animation curve " )
170
170
}
171
-
171
+
172
172
// Check calculation strategy type
173
173
if case . priorityThenPosition( let direction) = defaultConfig. calculationStrategy {
174
174
if case . leftToRight = direction {
@@ -179,4 +179,4 @@ import XCTest
179
179
} else {
180
180
XCTFail ( " Expected priorityThenPosition strategy " )
181
181
}
182
- }
182
+ }
0 commit comments