diff --git a/Source/Core/Constants/AccessibilityIdentifiers.swift b/Source/Core/Constants/AccessibilityIdentifiers.swift index 0c86760ac..5c907daaa 100644 --- a/Source/Core/Constants/AccessibilityIdentifiers.swift +++ b/Source/Core/Constants/AccessibilityIdentifiers.swift @@ -40,4 +40,8 @@ public enum AccessibilityIdentifiers { static public let phoneNumber = "PhoneNumberInput" } + public enum SecurityCodeComponent { + /// Identify security code component text field + static public let textField = "SecurityCodeTextField" + } } diff --git a/Source/UI/SecurityCodeComponent/SecurityCodeComponent.swift b/Source/UI/SecurityCodeComponent/SecurityCodeComponent.swift index 92cd02b5a..390819822 100644 --- a/Source/UI/SecurityCodeComponent/SecurityCodeComponent.swift +++ b/Source/UI/SecurityCodeComponent/SecurityCodeComponent.swift @@ -39,7 +39,7 @@ extension SecurityCodeComponent { let view = SecurityCodeView(viewModel: viewModel) view.update(style: DefaultSecurityCodeFormStyle(securityCodeComponentStyle: configuration.style)) - view.accessibilityIdentifier = AccessibilityIdentifiers.PaymentForm.cardSecurityCode + view.accessibilityIdentifier = AccessibilityIdentifiers.SecurityCodeComponent.textField view.delegate = self view.frame = bounds @@ -52,7 +52,7 @@ extension SecurityCodeComponent { extension SecurityCodeComponent: SecurityCodeViewDelegate { func update(securityCode: String) { - guard securityCode.count > 0 else { + guard securityCode.isEmpty else { isSecurityCodeValid(false) return } diff --git a/iOS Example Frame SPM/iOS Example Frame Regression Tests/Helpers/TestCard.swift b/iOS Example Frame SPM/iOS Example Frame Regression Tests/Helpers/TestCard.swift index 860b13aca..bb5d4774c 100644 --- a/iOS Example Frame SPM/iOS Example Frame Regression Tests/Helpers/TestCard.swift +++ b/iOS Example Frame SPM/iOS Example Frame Regression Tests/Helpers/TestCard.swift @@ -38,7 +38,7 @@ let tokenableTestCards: [TestCard] = [ ] /** - These are luhn numbers that are just 1 character less with the least character count of the relevant card schemes + These are luhn numbers that are just 1 character less than the min character count of the relevant card schemes For example, Visa cards must be at least 13 characters and must start with 44. So, we needed a luhn number that starts with 4 and is 12 digits. To see that we check the character count beyond the luhn verifications. diff --git a/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.pbxproj b/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.pbxproj index 40b5a19c4..69614b41d 100644 --- a/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.pbxproj +++ b/iOS Example Frame SPM/iOS Example Frame SPM.xcodeproj/project.pbxproj @@ -28,7 +28,8 @@ 16857B742A65F15F005CAE39 /* CardTypeTokenCreationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16857B732A65F15F005CAE39 /* CardTypeTokenCreationTests.swift */; }; 16857B7E2A65F3F3005CAE39 /* XCUIApplication+TestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16857B7D2A65F3F3005CAE39 /* XCUIApplication+TestHelpers.swift */; }; 168CEC952AC5C71700BB52B0 /* SecurityCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 168CEC942AC5C71700BB52B0 /* SecurityCodeViewController.swift */; }; - 16900D412AE2FAB3009A7CE9 /* Frames in Frameworks */ = {isa = PBXBuildFile; productRef = 16900D402AE2FAB3009A7CE9 /* Frames */; }; + 16900D442AE6BA38009A7CE9 /* SecurityCodeComponentUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16900D432AE6BA38009A7CE9 /* SecurityCodeComponentUITests.swift */; }; + 16900D4B2AE70F90009A7CE9 /* Frames in Frameworks */ = {isa = PBXBuildFile; productRef = 16900D4A2AE70F90009A7CE9 /* Frames */; }; 169DF1482A7BFB1B00891DF0 /* CardSchemeFormatSnapshotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 169DF1472A7BFB1B00891DF0 /* CardSchemeFormatSnapshotTests.swift */; }; 16C3F8402A7927ED00690639 /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = 16C3F83F2A7927ED00690639 /* SnapshotTesting */; }; 16C3F8422A7956EA00690639 /* CardValidationSnapshotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16C3F8412A7956EA00690639 /* CardValidationSnapshotTests.swift */; }; @@ -129,6 +130,7 @@ 16857B732A65F15F005CAE39 /* CardTypeTokenCreationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardTypeTokenCreationTests.swift; sourceTree = ""; }; 16857B7D2A65F3F3005CAE39 /* XCUIApplication+TestHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCUIApplication+TestHelpers.swift"; sourceTree = ""; }; 168CEC942AC5C71700BB52B0 /* SecurityCodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecurityCodeViewController.swift; sourceTree = ""; }; + 16900D432AE6BA38009A7CE9 /* SecurityCodeComponentUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecurityCodeComponentUITests.swift; sourceTree = ""; }; 169DF1472A7BFB1B00891DF0 /* CardSchemeFormatSnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardSchemeFormatSnapshotTests.swift; sourceTree = ""; }; 16AE74C32A5C1EBB0031F794 /* iOS Example Frame.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS Example Frame.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 16AE74C42A5C1EBB0031F794 /* iOS Example FrameUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "iOS Example FrameUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -219,7 +221,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 16900D412AE2FAB3009A7CE9 /* Frames in Frameworks */, + 16900D4B2AE70F90009A7CE9 /* Frames in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -413,6 +415,7 @@ isa = PBXGroup; children = ( 0BD2ECBE28B65DA10041A942 /* FrameUITests.swift */, + 16900D432AE6BA38009A7CE9 /* SecurityCodeComponentUITests.swift */, 0BD2ECC028B65EC20041A942 /* XCUIApplication+Extension.swift */, ); name = "iOS Example FrameUITests"; @@ -508,7 +511,7 @@ ); name = "iOS Example Frame"; packageProductDependencies = ( - 16900D402AE2FAB3009A7CE9 /* Frames */, + 16900D4A2AE70F90009A7CE9 /* Frames */, ); productName = "iOS Example Frame"; productReference = 16AE74C32A5C1EBB0031F794 /* iOS Example Frame.app */; @@ -557,7 +560,7 @@ mainGroup = E6646F8120CE6C0900D8353A; packageReferences = ( 16C3F83E2A7927ED00690639 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */, - 16900D3F2AE2FAB3009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */, + 16900D492AE70F90009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */, ); productRefGroup = E6646F8120CE6C0900D8353A; projectDirPath = ""; @@ -666,6 +669,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 16900D442AE6BA38009A7CE9 /* SecurityCodeComponentUITests.swift in Sources */, 0BD2ECBF28B65DA10041A942 /* FrameUITests.swift in Sources */, 0BD2ECC128B65EC20041A942 /* XCUIApplication+Extension.swift in Sources */, ); @@ -1209,12 +1213,12 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 16900D3F2AE2FAB3009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */ = { + 16900D492AE70F90009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "file:///Users/okhanokbay/Documents/frames-ios"; + repositoryURL = "https://github.com/checkout/frames-ios"; requirement = { - branch = "feature/cvv-component"; - kind = branch; + kind = upToNextMajorVersion; + minimumVersion = 4.2.1; }; }; 16C3F83E2A7927ED00690639 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = { @@ -1228,9 +1232,9 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 16900D402AE2FAB3009A7CE9 /* Frames */ = { + 16900D4A2AE70F90009A7CE9 /* Frames */ = { isa = XCSwiftPackageProductDependency; - package = 16900D3F2AE2FAB3009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */; + package = 16900D492AE70F90009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */; productName = Frames; }; 16C3F83F2A7927ED00690639 /* SnapshotTesting */ = { diff --git a/iOS Example Frame/iOS Example Frame/Storyboards/Base.lproj/Main.storyboard b/iOS Example Frame/iOS Example Frame/Storyboards/Base.lproj/Main.storyboard index 9073fe8a9..61948043f 100644 --- a/iOS Example Frame/iOS Example Frame/Storyboards/Base.lproj/Main.storyboard +++ b/iOS Example Frame/iOS Example Frame/Storyboards/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -320,8 +320,8 @@ -