@@ -51,6 +51,14 @@ final class GeneralAppSettingsTests: XCTestCase {
5151 XCTAssertEqual ( newSettings. feedbacks [ . general] , newFeedback)
5252 }
5353
54+ func test_isPOSSurveyNotificationScheduled_defaults_to_false( ) {
55+ // Given
56+ let settings = createGeneralAppSettings ( )
57+
58+ // Then
59+ XCTAssertFalse ( settings. isPOSSurveyNotificationScheduled)
60+ }
61+
5462 func test_updating_properties_to_generalAppSettings_does_not_breaks_decoding( ) throws {
5563 // Given
5664 let installationDate = Date ( timeIntervalSince1970: 1630314000 ) // Mon Aug 30 2021 09:00:00 UTC+0000
@@ -63,6 +71,7 @@ final class GeneralAppSettingsTests: XCTestCase {
6371 FeatureAnnouncementCampaignSettings ( dismissedDate: Date ( ) , remindAfter: nil ) ]
6472 let sitesWithAtLeastOneIPPTransactionFinished : Set < Int64 > = [ 1234 , 123 , 12 , 1 ]
6573 let isCustomFieldsTopBannerDismissed = true
74+ let isPOSSurveyNotificationScheduled = true
6675 let previousSettings = GeneralAppSettings ( installationDate: installationDate,
6776 feedbacks: feedbackSettings,
6877 isViewAddOnsSwitchEnabled: true ,
@@ -74,13 +83,14 @@ final class GeneralAppSettingsTests: XCTestCase {
7483 sitesWithAtLeastOneIPPTransactionFinished: sitesWithAtLeastOneIPPTransactionFinished,
7584 isEUShippingNoticeDismissed: false ,
7685 isCustomFieldsTopBannerDismissed: isCustomFieldsTopBannerDismissed,
77- isPOSSurveyNotificationScheduled: false )
86+ isPOSSurveyNotificationScheduled: isPOSSurveyNotificationScheduled )
7887
7988 let previousEncodedSettings = try JSONEncoder ( ) . encode ( previousSettings)
8089 var previousSettingsJson = try JSONSerialization . jsonObject ( with: previousEncodedSettings, options: . allowFragments) as? [ String : Any ]
8190
8291 // When
8392 previousSettingsJson? . removeValue ( forKey: " isViewAddOnsSwitchEnabled " )
93+ previousSettingsJson? . removeValue ( forKey: " isPOSSurveyNotificationScheduled " )
8494 let newEncodedSettings = try JSONSerialization . data ( withJSONObject: previousSettingsJson as Any , options: . fragmentsAllowed)
8595 let newSettings = try JSONDecoder ( ) . decode ( GeneralAppSettings . self, from: newEncodedSettings)
8696
@@ -94,6 +104,7 @@ final class GeneralAppSettingsTests: XCTestCase {
94104 assertEqual ( newSettings. featureAnnouncementCampaignSettings, featureAnnouncementCampaignSettings)
95105 assertEqual ( newSettings. sitesWithAtLeastOneIPPTransactionFinished, sitesWithAtLeastOneIPPTransactionFinished)
96106 assertEqual ( newSettings. isCustomFieldsTopBannerDismissed, isCustomFieldsTopBannerDismissed)
107+ assertEqual ( newSettings. isPOSSurveyNotificationScheduled, false )
97108 }
98109}
99110
0 commit comments