check notification center notifications
This commit is contained in:
parent
60aa4c634a
commit
ddd69720a1
1 changed files with 10 additions and 1 deletions
|
|
@ -56,11 +56,14 @@ final class PasswordStoreTest: XCTestCase {
|
||||||
XCTAssertGreaterThan(passwordStore.numberOfPasswords, 0)
|
XCTAssertGreaterThan(passwordStore.numberOfPasswords, 0)
|
||||||
XCTAssertNotNil(passwordStore.gitRepository)
|
XCTAssertNotNil(passwordStore.gitRepository)
|
||||||
|
|
||||||
|
expectation(forNotification: .passwordStoreUpdated, object: nil)
|
||||||
|
expectation(forNotification: .passwordStoreErased, object: nil)
|
||||||
passwordStore.eraseStoreData()
|
passwordStore.eraseStoreData()
|
||||||
|
|
||||||
XCTAssertFalse(FileManager.default.fileExists(atPath: localRepoURL.path))
|
XCTAssertFalse(FileManager.default.fileExists(atPath: localRepoURL.path))
|
||||||
XCTAssertEqual(passwordStore.numberOfPasswords, 0)
|
XCTAssertEqual(passwordStore.numberOfPasswords, 0)
|
||||||
XCTAssertNil(passwordStore.gitRepository)
|
XCTAssertNil(passwordStore.gitRepository)
|
||||||
|
waitForExpectations(timeout: 1, handler: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testErase() throws {
|
func testErase() throws {
|
||||||
|
|
@ -75,6 +78,8 @@ final class PasswordStoreTest: XCTestCase {
|
||||||
XCTAssertTrue(PasscodeLock.shared.hasPasscode)
|
XCTAssertTrue(PasscodeLock.shared.hasPasscode)
|
||||||
XCTAssertTrue(PGPAgent.shared.isInitialized())
|
XCTAssertTrue(PGPAgent.shared.isInitialized())
|
||||||
|
|
||||||
|
expectation(forNotification: .passwordStoreUpdated, object: nil)
|
||||||
|
expectation(forNotification: .passwordStoreErased, object: nil)
|
||||||
passwordStore.erase()
|
passwordStore.erase()
|
||||||
|
|
||||||
XCTAssertEqual(passwordStore.numberOfPasswords, 0)
|
XCTAssertEqual(passwordStore.numberOfPasswords, 0)
|
||||||
|
|
@ -82,6 +87,7 @@ final class PasswordStoreTest: XCTestCase {
|
||||||
XCTAssertFalse(Defaults.hasKey(\.gitSignatureName))
|
XCTAssertFalse(Defaults.hasKey(\.gitSignatureName))
|
||||||
XCTAssertFalse(PasscodeLock.shared.hasPasscode)
|
XCTAssertFalse(PasscodeLock.shared.hasPasscode)
|
||||||
XCTAssertFalse(PGPAgent.shared.isInitialized())
|
XCTAssertFalse(PGPAgent.shared.isInitialized())
|
||||||
|
waitForExpectations(timeout: 1, handler: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testFetchPasswordEntityCoreDataByParent() throws {
|
func testFetchPasswordEntityCoreDataByParent() throws {
|
||||||
|
|
@ -171,8 +177,11 @@ final class PasswordStoreTest: XCTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func cloneRepository(_ remote: RemoteRepo) throws {
|
private func cloneRepository(_ remote: RemoteRepo) throws {
|
||||||
try passwordStore.cloneRepository(remoteRepoURL: remote.url, branchName: remote.branchName)
|
|
||||||
expectation(for: NSPredicate { _, _ in FileManager.default.fileExists(atPath: self.localRepoURL.path) }, evaluatedWith: nil)
|
expectation(for: NSPredicate { _, _ in FileManager.default.fileExists(atPath: self.localRepoURL.path) }, evaluatedWith: nil)
|
||||||
|
expectation(forNotification: .passwordStoreUpdated, object: nil)
|
||||||
|
|
||||||
|
try passwordStore.cloneRepository(remoteRepoURL: remote.url, branchName: remote.branchName)
|
||||||
|
|
||||||
waitForExpectations(timeout: 3, handler: nil)
|
waitForExpectations(timeout: 3, handler: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue