@@ -27,7 +27,9 @@ class InitialSyncOperationTests: XCTestCase {
27
27
func testFullSyncWhenLastSyncPredicateNilAndCurrentSyncPredicateNonNil( ) {
28
28
let lastSyncTime : Int64 = 123456
29
29
let lastSyncPredicate : String ? = nil
30
- let currentSyncPredicate = DataStoreConfiguration . custom (
30
+ let currentSyncPredicate : DataStoreConfiguration
31
+ #if os(watchOS)
32
+ currentSyncPredicate = DataStoreConfiguration . custom (
31
33
syncExpressions: [
32
34
. syncExpression(
33
35
MockSynced . schema,
@@ -36,6 +38,17 @@ class InitialSyncOperationTests: XCTestCase {
36
38
] ,
37
39
disableSubscriptions: { false }
38
40
)
41
+ #else
42
+ currentSyncPredicate = DataStoreConfiguration . custom (
43
+ syncExpressions: [
44
+ . syncExpression(
45
+ MockSynced . schema,
46
+ where: { MockSynced . keys. id. eq ( " 123 " ) }
47
+ )
48
+ ]
49
+ )
50
+ #endif
51
+
39
52
let expectedSyncType = SyncType . fullSync
40
53
let expectedLastSync : Int64 ? = nil
41
54
@@ -82,7 +95,7 @@ class InitialSyncOperationTests: XCTestCase {
82
95
api: nil ,
83
96
reconciliationQueue: nil ,
84
97
storageAdapter: nil ,
85
- dataStoreConfiguration: . custom ( disableSubscriptions : { false } ) ,
98
+ dataStoreConfiguration: . testDefault ( ) ,
86
99
authModeStrategy: AWSDefaultAuthModeStrategy ( ) )
87
100
let sink = operation
88
101
. publisher
@@ -110,7 +123,9 @@ class InitialSyncOperationTests: XCTestCase {
110
123
func testFullSyncWhenLastSyncPredicateDifferentFromCurrentSyncPredicate( ) {
111
124
let lastSyncTime : Int64 = 123456
112
125
let lastSyncPredicate : String ? = " non nil different from current predicate "
113
- let currentSyncPredicate = DataStoreConfiguration . custom (
126
+ let currentSyncPredicate : DataStoreConfiguration
127
+ #if os(watchOS)
128
+ currentSyncPredicate = DataStoreConfiguration . custom (
114
129
syncExpressions: [
115
130
. syncExpression(
116
131
MockSynced . schema,
@@ -119,6 +134,17 @@ class InitialSyncOperationTests: XCTestCase {
119
134
] ,
120
135
disableSubscriptions: { false }
121
136
)
137
+ #else
138
+ currentSyncPredicate = DataStoreConfiguration . custom (
139
+ syncExpressions: [
140
+ . syncExpression(
141
+ MockSynced . schema,
142
+ where: { MockSynced . keys. id. eq ( " 123 " ) }
143
+ )
144
+ ]
145
+ )
146
+ #endif
147
+
122
148
let expectedSyncType = SyncType . fullSync
123
149
let expectedLastSync : Int64 ? = nil
124
150
@@ -157,7 +183,9 @@ class InitialSyncOperationTests: XCTestCase {
157
183
let startDateSeconds = ( Int64 ( Date ( ) . timeIntervalSince1970) - 100 )
158
184
let lastSyncTime : Int64 = startDateSeconds * 1_000
159
185
let lastSyncPredicate : String ? = " { \" field \" : \" id \" , \" operator \" :{ \" type \" : \" equals \" , \" value \" : \" 123 \" }} "
160
- let currentSyncPredicate = DataStoreConfiguration . custom (
186
+ let currentSyncPredicate : DataStoreConfiguration
187
+ #if os(watchOS)
188
+ currentSyncPredicate = DataStoreConfiguration . custom (
161
189
syncExpressions: [
162
190
. syncExpression(
163
191
MockSynced . schema,
@@ -166,6 +194,17 @@ class InitialSyncOperationTests: XCTestCase {
166
194
] ,
167
195
disableSubscriptions: { false }
168
196
)
197
+ #else
198
+ currentSyncPredicate = DataStoreConfiguration . custom (
199
+ syncExpressions: [
200
+ . syncExpression(
201
+ MockSynced . schema,
202
+ where: { MockSynced . keys. id. eq ( " 123 " ) }
203
+ )
204
+ ]
205
+ )
206
+ #endif
207
+
169
208
let expectedSyncType = SyncType . deltaSync
170
209
let expectedLastSync : Int64 ? = lastSyncTime
171
210
0 commit comments