File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed
Modules/Sources/NetworkingCore/Network Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -280,6 +280,7 @@ extension UserDefaults {
280280 }
281281
282282 enum Key : String {
283+ /// This key is shared with the UI layer, so ensure to keep it in-sync with `UserDefaults+Woo`.
283284 case applicationPasswordUnsupportedList
284285 }
285286}
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import Foundation
66//
77extension UserDefaults {
88 enum Key : String {
9+ case applicationPasswordUnsupportedList
910 case defaultCredentialsType
1011 case defaultAccountID
1112 case defaultUsername
Original file line number Diff line number Diff line change @@ -225,6 +225,7 @@ final class SessionManager: SessionManagerProtocol {
225225 defaults [ . blazeSelectedCampaignObjective] = nil
226226 defaults [ . wpcomSiteSuspended] = nil
227227 defaults [ . tapToPayAwarenessMomentFirstLaunchCompleted] = nil
228+ defaults [ . applicationPasswordUnsupportedList] = nil
228229 resetTimestampsValues ( )
229230 imageCache. clearCache ( )
230231 }
Original file line number Diff line number Diff line change @@ -378,6 +378,28 @@ final class SessionManagerTests: XCTestCase {
378378 XCTAssertTrue ( mockCache. clearCacheCalled)
379379 }
380380
381+ /// Verifies that image cache is cleared upon reset
382+ ///
383+ func test_applicationPasswordUnsupportedList_is_cleared_upon_reset( ) throws {
384+ // Given
385+ let siteID : Int64 = 13
386+ let uuid = UUID ( ) . uuidString
387+ let defaults = try XCTUnwrap ( UserDefaults ( suiteName: uuid) )
388+ let sut = SessionManager ( defaults: defaults, keychainServiceName: Settings . keychainServiceName)
389+
390+ // When
391+ defaults [ . applicationPasswordUnsupportedList] = [ siteID]
392+
393+ // Then
394+ XCTAssertEqual ( try XCTUnwrap ( defaults [ . applicationPasswordUnsupportedList] as? [ Int64 ] ) , [ siteID] )
395+
396+ // When
397+ sut. reset ( )
398+
399+ // Then
400+ XCTAssertNil ( defaults [ . applicationPasswordUnsupportedList] )
401+ }
402+
381403 /// Verifies that `removeDefaultCredentials` effectively nukes everything from the keychain
382404 ///
383405 func testDefaultCredentialsAreEffectivelyNuked( ) {
You can’t perform that action at this time.
0 commit comments