@@ -489,7 +489,7 @@ final class ProductMapperTests: XCTestCase {
489489 XCTAssertEqual ( product. customFields. first? . value. stringValue, " 10 " )
490490 }
491491
492- /// Test that metadata and subscription are properly encoded.
492+ /// Test that only subscription details are encoded for metadata .
493493 ///
494494 func test_metadata_and_subscription_are_properly_encoded( ) throws {
495495 // Given
@@ -524,7 +524,7 @@ final class ProductMapperTests: XCTestCase {
524524 // Then
525525 XCTAssertNotNil ( encodedJSON)
526526 let encodedMetadata = encodedJSON ? [ " meta_data " ] as? [ [ String : Any ] ]
527- XCTAssertEqual ( encodedMetadata? . count, customFields . count + subscription. toKeyValuePairs ( ) . count) // Including subscription metadata
527+ XCTAssertEqual ( encodedMetadata? . count, subscription. toKeyValuePairs ( ) . count) // Including only subscription metadata
528528 XCTAssertEqual ( encodedMetadata ? [ 0 ] [ " key " ] as? String , " _subscription_length " )
529529 XCTAssertEqual ( encodedMetadata ? [ 0 ] [ " value " ] as? String , subscription. length)
530530 XCTAssertEqual ( encodedMetadata ? [ 1 ] [ " key " ] as? String , " _subscription_period " )
@@ -541,12 +541,6 @@ final class ProductMapperTests: XCTestCase {
541541 XCTAssertEqual ( encodedMetadata ? [ 6 ] [ " value " ] as? String , subscription. trialPeriod. rawValue)
542542 XCTAssertEqual ( encodedMetadata ? [ 7 ] [ " key " ] as? String , " _subscription_one_time_shipping " )
543543 XCTAssertEqual ( encodedMetadata ? [ 7 ] [ " value " ] as? String , subscription. oneTimeShipping ? " yes " : " no " )
544- XCTAssertEqual ( Int64 ( encodedMetadata ? [ 8 ] [ " id " ] as? String ?? " " ) , customFields [ 0 ] . metadataID)
545- XCTAssertEqual ( encodedMetadata ? [ 8 ] [ " key " ] as? String , customFields [ 0 ] . key)
546- XCTAssertEqual ( encodedMetadata ? [ 8 ] [ " value " ] as? String , customFields [ 0 ] . value. stringValue)
547- XCTAssertEqual ( Int64 ( encodedMetadata ? [ 9 ] [ " id " ] as? String ?? " " ) , customFields [ 1 ] . metadataID)
548- XCTAssertEqual ( encodedMetadata ? [ 9 ] [ " key " ] as? String , customFields [ 1 ] . key)
549- XCTAssertEqual ( encodedMetadata ? [ 9 ] [ " value " ] as? String , customFields [ 1 ] . value. stringValue)
550544 }
551545
552546 /// Test that attributes are properly encoded.
0 commit comments