From 8e1c85114bc4c0dd5583c15b074105fc4be103e0 Mon Sep 17 00:00:00 2001 From: Brian Hall Date: Fri, 30 Aug 2024 15:08:32 +0200 Subject: [PATCH] Support min/max values in the JSON for random number generation (#3177) Task/Issue URL: https://app.asana.com/0/0/1208188892446269/f Tech Design URL: CC: **Description**: **Steps to test this PR**: 1. **Definition of Done**: * [ ] Does this PR satisfy our [Definition of Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)? --- ###### Internal references: [Pull Request Review Checklist](https://app.asana.com/0/1202500774821704/1203764234894239/f) [Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552) [Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943) [Pull Request Documentation](https://app.asana.com/0/1202500774821704/1204012835277482/f) --- .../Sources/DataBrokerProtection/Model/PageElement.swift | 2 ++ .../DataBrokerOperationActionTests.swift | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/PageElement.swift b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/PageElement.swift index ee049d3908..a184c4bb65 100644 --- a/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/PageElement.swift +++ b/LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Model/PageElement.swift @@ -22,6 +22,8 @@ struct PageElement: Codable, Sendable { let selector: String let parent: ParentElement? let multiple: Bool? + let min: String? + let max: String? } struct ProfileMatch: Codable, Sendable { diff --git a/LocalPackages/DataBrokerProtection/Tests/DataBrokerProtectionTests/DataBrokerOperationActionTests.swift b/LocalPackages/DataBrokerProtection/Tests/DataBrokerProtectionTests/DataBrokerOperationActionTests.swift index edb72a0ac3..330619c12d 100644 --- a/LocalPackages/DataBrokerProtection/Tests/DataBrokerProtectionTests/DataBrokerOperationActionTests.swift +++ b/LocalPackages/DataBrokerProtection/Tests/DataBrokerProtectionTests/DataBrokerOperationActionTests.swift @@ -128,7 +128,7 @@ final class DataBrokerOperationActionTests: XCTestCase { } func testWhenActionNeedsEmail_thenExtractedProfileEmailIsSet() async { - let fillFormAction = FillFormAction(id: "1", actionType: .fillForm, selector: "#test", elements: [.init(type: "email", selector: "#email", parent: nil, multiple: nil)], dataSource: nil) + let fillFormAction = FillFormAction(id: "1", actionType: .fillForm, selector: "#test", elements: [.init(type: "email", selector: "#email", parent: nil, multiple: nil, min: nil, max: nil)], dataSource: nil) let step = Step(type: .optOut, actions: [fillFormAction]) let sut = OptOutJob( privacyConfig: PrivacyConfigurationManagingMock(), @@ -152,7 +152,7 @@ final class DataBrokerOperationActionTests: XCTestCase { } func testWhenGetEmailServiceFails_thenOperationThrows() async { - let fillFormAction = FillFormAction(id: "1", actionType: .fillForm, selector: "#test", elements: [.init(type: "email", selector: "#email", parent: nil, multiple: nil)], dataSource: nil) + let fillFormAction = FillFormAction(id: "1", actionType: .fillForm, selector: "#test", elements: [.init(type: "email", selector: "#email", parent: nil, multiple: nil, min: nil, max: nil)], dataSource: nil) let step = Step(type: .optOut, actions: [fillFormAction]) let sut = OptOutJob( privacyConfig: PrivacyConfigurationManagingMock(),