Skip to content

Commit 0d94029

Browse files
committed
Update test for InboxNoteListMapper
1 parent a7c0fa4 commit 0d94029

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Networking/NetworkingTests/Mapper/InboxNoteListMapperTests.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ final class InboxNoteListMapperTests: XCTestCase {
1414
XCTAssertEqual(inboxNotes.count, 24)
1515
}
1616

17+
/// Verifies that the whole list is parsed when response has no data envelope.
18+
///
19+
func test_InboxNoteListMapper_parses_all_InboxNotes_in_response_without_data_envelope() throws {
20+
let inboxNotes = try mapLoadInboxNoteListResponseWithoutDataEnvelope()
21+
XCTAssertEqual(inboxNotes.count, 2)
22+
}
23+
1724
/// Verifies that the `siteID` is added in the mapper, to all results, because it's not provided by the API endpoint.
1825
///
1926
func test_InboxNoteListMapper_includes_siteID_in_parsed_results() throws {
@@ -77,4 +84,10 @@ private extension InboxNoteListMapperTests {
7784
func mapLoadInboxNoteListResponse() throws -> [InboxNote] {
7885
return try mapInboxNoteList(from: "inbox-note-list")
7986
}
87+
88+
/// Returns the InboxNoteListMapper output from `inbox-note-list-without-data.json`
89+
///
90+
func mapLoadInboxNoteListResponseWithoutDataEnvelope() throws -> [InboxNote] {
91+
return try mapInboxNoteList(from: "inbox-note-list-without-data")
92+
}
8093
}

0 commit comments

Comments
 (0)