From a1d021ba282ed709a32a634db594110a6cc0be3b Mon Sep 17 00:00:00 2001 From: amddg44 Date: Mon, 18 Mar 2024 10:58:09 +0100 Subject: [PATCH] Update to mocks --- DuckDuckGoTests/MockSecureVault.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/DuckDuckGoTests/MockSecureVault.swift b/DuckDuckGoTests/MockSecureVault.swift index 94c1cb0def..ad0cac1d33 100644 --- a/DuckDuckGoTests/MockSecureVault.swift +++ b/DuckDuckGoTests/MockSecureVault.swift @@ -96,6 +96,12 @@ final class MockSecureVault: AutofillSecureVault { return accountID } + func updateLastUsedFor(accountId: Int64) throws { + if var account = storedAccounts.first(where: { $0.id == String(accountId) }) { + account.lastUsed = Date() + } + } + func deleteWebsiteCredentialsFor(accountId: Int64) throws { storedCredentials[accountId] = nil } @@ -274,6 +280,12 @@ class MockDatabaseProvider: AutofillDatabaseProvider { return _accounts } + func updateLastUsedForAccountId(_ accountId: Int64) throws { + if var account = _accounts.first(where: { $0.id == String(accountId) }) { + account.lastUsed = Date() + } + } + func deleteWebsiteCredentialsForAccountId(_ accountId: Int64) throws { self._accounts = self._accounts.filter { $0.id != String(accountId) } }