File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Networking/NetworkingTests/Mapper Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,20 @@ final class InboxNoteMapperTests: XCTestCase {
77 ///
88 private let dummySiteID : Int64 = 12983476
99
10- /// Verifies that the whole list is parsed.
10+ /// Verifies that the inbox note is parsed.
1111 ///
1212 func test_InboxNoteMapper_parses_the_InboxNote_in_response( ) throws {
1313 let inboxNote = try mapLoadInboxNoteResponse ( )
1414 XCTAssertNotNil ( inboxNote)
1515 }
1616
17+ /// Verifies that the inbox note is parsed when response has no data envelope.
18+ ///
19+ func test_InboxNoteMapper_parses_the_InboxNote_in_response_without_data_envelope( ) throws {
20+ let inboxNote = try mapLoadInboxNoteResponseWithoutDataEnvelope ( )
21+ XCTAssertNotNil ( inboxNote)
22+ }
23+
1724 /// Verifies that the `siteID` is added in the mapper, because it's not provided by the API endpoint.
1825 ///
1926 func test_InboxNoteMapper_includes_siteID_in_parsed_result( ) throws {
@@ -83,6 +90,12 @@ private extension InboxNoteMapperTests {
8390 return try mapInboxNote ( from: " inbox-note " )
8491 }
8592
93+ /// Returns the InboxNoteMapper output from `inbox-note-without-data.json`
94+ ///
95+ func mapLoadInboxNoteResponseWithoutDataEnvelope( ) throws -> InboxNote ? {
96+ return try mapInboxNote ( from: " inbox-note-without-data " )
97+ }
98+
8699 /// Returns the InboxNoteMapper output from `inbox-note-without-isRead.json`
87100 ///
88101 func mapLoadInboxNoteWithoutIsReadResponse( ) throws -> InboxNote ? {
You can’t perform that action at this time.
0 commit comments