mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Share the test passphrase through a RestorationTokenFixtures enum.
The legacy restoration token formats store the passphrase as a base64 string whereas the current one exposes Data, so keep both representations of the same value in one place instead of repeating the conversions in every test.
This commit is contained in:
@@ -36,7 +36,7 @@ struct KeychainControllerTests {
|
||||
oauthData: "oauthData",
|
||||
slidingSyncVersion: .native),
|
||||
sessionDirectories: .init(),
|
||||
passphrase: Data("passphrase".utf8),
|
||||
passphrase: RestorationTokenFixtures.passphrase,
|
||||
pusherNotificationClientIdentifier: "pusherClientID")
|
||||
keychain.setRestorationToken(restorationToken, forUsername: username)
|
||||
|
||||
@@ -56,7 +56,7 @@ struct KeychainControllerTests {
|
||||
oauthData: "oauthData",
|
||||
slidingSyncVersion: .native),
|
||||
sessionDirectories: .init(),
|
||||
passphrase: Data("passphrase".utf8),
|
||||
passphrase: RestorationTokenFixtures.passphrase,
|
||||
pusherNotificationClientIdentifier: "pusherClientID")
|
||||
keychain.setRestorationToken(restorationToken, forUsername: username)
|
||||
#expect(keychain.restorationTokens().count == 1, "The keychain should have 1 restoration token.")
|
||||
@@ -82,7 +82,7 @@ struct KeychainControllerTests {
|
||||
oauthData: "oauthData",
|
||||
slidingSyncVersion: .native),
|
||||
sessionDirectories: .init(),
|
||||
passphrase: Data("passphrase".utf8),
|
||||
passphrase: RestorationTokenFixtures.passphrase,
|
||||
pusherNotificationClientIdentifier: "pusherClientID")
|
||||
keychain.setRestorationToken(restorationToken, forUsername: "@test\(index):example.com")
|
||||
}
|
||||
@@ -107,7 +107,7 @@ struct KeychainControllerTests {
|
||||
oauthData: "oauthData",
|
||||
slidingSyncVersion: .native),
|
||||
sessionDirectories: .init(),
|
||||
passphrase: Data("passphrase".utf8),
|
||||
passphrase: RestorationTokenFixtures.passphrase,
|
||||
pusherNotificationClientIdentifier: "pusherClientID")
|
||||
keychain.setRestorationToken(restorationToken, forUsername: "@test\(index):example.com")
|
||||
}
|
||||
@@ -141,7 +141,7 @@ struct KeychainControllerTests {
|
||||
oidcData: nil,
|
||||
slidingSyncVersion: .proxy(url: "https://sync.example.com")),
|
||||
sessionDirectory: .sessionsBaseDirectory.appending(component: UUID().uuidString),
|
||||
passphrase: Data("passphrase".utf8).base64EncodedString(),
|
||||
passphrase: RestorationTokenFixtures.base64Passphrase,
|
||||
pusherNotificationClientIdentifier: "pusherClientID")
|
||||
let tokenData = try JSONEncoder().encode(unsupportedToken)
|
||||
try underlyingKeychain.set(tokenData, key: "@test:example.com")
|
||||
|
||||
Reference in New Issue
Block a user