File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
WooCommerce/WooCommerceTests/System Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,29 @@ class SessionManagerTests: XCTestCase {
6262 XCTAssertEqual ( retrieved, Settings . wporgCredentials)
6363 }
6464
65+ /// Verifies that application password is deleted upon calling `deleteApplicationPassword`
66+ ///
67+ func test_deleteApplicationPassword_deletes_password_from_keychain( ) {
68+ // Given
69+ manager. defaultCredentials = Settings . wporgCredentials
70+ let storage = ApplicationPasswordStorage ( keychain: Keychain ( service: Settings . keychainServiceName) )
71+ let password = ApplicationPassword ( wpOrgUsername: " username " , password: Secret ( " pass " ) )
72+
73+ // When
74+ storage. saveApplicationPassword ( password)
75+
76+ // Then
77+ XCTAssertNotNil ( storage. applicationPassword)
78+
79+ // When
80+ manager. deleteApplicationPassword ( )
81+
82+ // Then
83+ waitUntil {
84+ storage. applicationPassword == nil
85+ }
86+ }
87+
6588 /// Verifies that application password is deleted upon reset
6689 ///
6790 func test_application_password_is_deleted_upon_reset( ) {
You can’t perform that action at this time.
0 commit comments