@@ -137,7 +137,8 @@ struct BookingsRemoteTests {
137137 from: sampleSiteID,
138138 bookingID: bookingID,
139139 attendanceStatus: . noShow,
140- bookingStatus: nil
140+ bookingStatus: nil ,
141+ note: nil
141142 )
142143
143144 // Then
@@ -157,7 +158,8 @@ struct BookingsRemoteTests {
157158 from: sampleSiteID,
158159 bookingID: bookingID,
159160 attendanceStatus: . noShow,
160- bookingStatus: nil
161+ bookingStatus: nil ,
162+ note: nil
161163 )
162164
163165 // Then
@@ -179,7 +181,8 @@ struct BookingsRemoteTests {
179181 from: sampleSiteID,
180182 bookingID: bookingID,
181183 attendanceStatus: nil ,
182- bookingStatus: . confirmed
184+ bookingStatus: . confirmed,
185+ note: nil
183186 )
184187
185188 // Then
@@ -201,7 +204,8 @@ struct BookingsRemoteTests {
201204 from: sampleSiteID,
202205 bookingID: bookingID,
203206 attendanceStatus: . booked,
204- bookingStatus: . paid
207+ bookingStatus: . paid,
208+ note: nil
205209 )
206210
207211 // Then
@@ -254,4 +258,28 @@ struct BookingsRemoteTests {
254258 #expect( ( parameters [ " page " ] as? String ) == " 3 " )
255259 #expect( ( parameters [ " per_page " ] as? String ) == " 100 " )
256260 }
261+
262+ @Test func test_updateBookingNote_sends_correct_parameters_for_booking_note( ) async throws {
263+ // Given
264+ let remote = BookingsRemote ( network: network)
265+ let bookingID : Int64 = 206
266+ network. simulateResponse ( requestUrlSuffix: " bookings/ \( bookingID) " , filename: " booking-no-create-update-dates " )
267+
268+ // When
269+ _ = try await remote. updateBooking (
270+ from: sampleSiteID,
271+ bookingID: bookingID,
272+ attendanceStatus: nil ,
273+ bookingStatus: nil ,
274+ note: " hello "
275+ )
276+
277+ // Then
278+ let request = try #require( network. requestsForResponseData. first as? JetpackRequest )
279+ let parameters = request. parameters
280+
281+ #expect( parameters [ " attendance_status " ] == nil )
282+ #expect( parameters [ " status " ] == nil )
283+ #expect( ( parameters [ " note " ] as? String ) == " hello " )
284+ }
257285}
0 commit comments