File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Networking/NetworkingTests/Mapper Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,18 @@ class SiteAPIMapperTests: XCTestCase {
3030 XCTAssertEqual ( apiSettings? . highestWooVersion, WooAPIVersion . mark3)
3131 }
3232
33+ /// Verifies the SiteSetting fields are parsed correctly.
34+ ///
35+ func test_SiteSetting_fields_are_properly_parsed_when_response_has_no_data_envelope( ) {
36+ let apiSettings = mapLoadSiteAPIResponseWithoutDataEnvelope ( )
37+
38+ XCTAssertNotNil ( apiSettings)
39+ XCTAssertEqual ( apiSettings? . siteID, dummySiteID)
40+ XCTAssertNotNil ( apiSettings? . namespaces)
41+ XCTAssertEqual ( apiSettings? . namespaces, dummyNamespaces)
42+ XCTAssertEqual ( apiSettings? . highestWooVersion, WooAPIVersion . mark3)
43+ }
44+
3345 /// Verifies the SiteSetting fields are parsed correctly.
3446 ///
3547 func test_broken_SiteSetting_fields_are_properly_parsed( ) {
@@ -64,6 +76,12 @@ private extension SiteAPIMapperTests {
6476 return mapSiteAPIData ( from: " site-api " )
6577 }
6678
79+ /// Returns the SiteAPIMapper output upon receiving `site-api-without-data`
80+ ///
81+ func mapLoadSiteAPIResponseWithoutDataEnvelope( ) -> SiteAPI ? {
82+ return mapSiteAPIData ( from: " site-api-without-data " )
83+ }
84+
6785 /// Returns the SiteAPIMapper output upon receiving `site-api`
6886 ///
6987 func mapLoadBrokenSiteAPIResponse( ) -> SiteAPI ? {
You can’t perform that action at this time.
0 commit comments