From f1895cc4a332e9361eae0a03190d956d8c42bc56 Mon Sep 17 00:00:00 2001 From: Colin Tremblay Date: Fri, 2 Feb 2024 13:26:32 -0700 Subject: [PATCH] cover the failing scenario with a test --- .../OIDCLegacyMigratorTests.swift | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Tests/AuthFoundationTests/OIDCLegacyMigratorTests.swift b/Tests/AuthFoundationTests/OIDCLegacyMigratorTests.swift index 65250058b..e1825dca1 100644 --- a/Tests/AuthFoundationTests/OIDCLegacyMigratorTests.swift +++ b/Tests/AuthFoundationTests/OIDCLegacyMigratorTests.swift @@ -96,8 +96,22 @@ final class OIDCLegacyMigratorTests: XCTestCase { ] ] as CFArray) XCTAssertTrue(migrator.needsMigration) + + // Test that a clientId match counts as a match + keychain.expect(noErr, result: [ + [ + "svce": "", + "acct": "clientId", + "class": "genp", + "cdat": Date(), + "mdat": Date(), + "pdmn": "ak", + "agrp": "com.okta.sample.app" + ] + ] as CFArray) + XCTAssertTrue(migrator.needsMigration) } - + func testMigrate() throws { let notificationRecorder = NotificationRecorder(observing: [ .credentialMigrated ])