From cf13233a359fa68648994af6bd713fd86cdf262c Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 17 May 2022 09:01:54 -0400 Subject: [PATCH] Show changes working by removing no longer required empty props objects Signed-off-by: Sebastian Malton --- .../+extensions/install-from-input/install-from-input.tsx | 4 ++-- .../components/input/__tests__/input_validators.test.ts | 6 +++--- src/renderer/components/input/input_validators.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/+extensions/install-from-input/install-from-input.tsx b/src/renderer/components/+extensions/install-from-input/install-from-input.tsx index ab85221421..0b8912d8ec 100644 --- a/src/renderer/components/+extensions/install-from-input/install-from-input.tsx +++ b/src/renderer/components/+extensions/install-from-input/install-from-input.tsx @@ -34,7 +34,7 @@ export const installFromInput = ({ try { // fixme: improve error messages for non-tar-file URLs - if (InputValidators.isUrl.validate(input, {})) { + if (InputValidators.isUrl.validate(input)) { // install via url disposer = extensionInstallationStateStore.startPreInstall(); const { promise } = downloadFile({ url: input, timeout: 10 * 60 * 1000 }); @@ -44,7 +44,7 @@ export const installFromInput = ({ } try { - await InputValidators.isPath.validate(input, {}); + await InputValidators.isPath.validate(input); // install from system path const fileName = path.basename(input); diff --git a/src/renderer/components/input/__tests__/input_validators.test.ts b/src/renderer/components/input/__tests__/input_validators.test.ts index ae45b998dd..5d1356510b 100644 --- a/src/renderer/components/input/__tests__/input_validators.test.ts +++ b/src/renderer/components/input/__tests__/input_validators.test.ts @@ -21,7 +21,7 @@ describe("input validation tests", () => { ]; it.each(tests)("validate %s", (input, output) => { - expect(isEmail.validate(input, {})).toBe(output); + expect(isEmail.validate(input)).toBe(output); }); }); @@ -38,7 +38,7 @@ describe("input validation tests", () => { ]; it.each(cases)("validate %s", (input, output) => { - expect(isUrl.validate(input, {})).toBe(output); + expect(isUrl.validate(input)).toBe(output); }); }); @@ -68,7 +68,7 @@ describe("input validation tests", () => { ]; it.each(tests)("validate %s", (input, output) => { - expect(systemName.validate(input, {})).toBe(output); + expect(systemName.validate(input)).toBe(output); }); }); }); diff --git a/src/renderer/components/input/input_validators.ts b/src/renderer/components/input/input_validators.ts index 362248fa17..59e550b803 100644 --- a/src/renderer/components/input/input_validators.ts +++ b/src/renderer/components/input/input_validators.ts @@ -162,7 +162,7 @@ export const systemName = inputValidator({ export const accountId = inputValidator({ message: () => `Invalid account ID`, - validate: (value, props) => (isEmail.validate(value, props) || systemName.validate(value, props)), + validate: (value) => (isEmail.validate(value) || systemName.validate(value)), }); export const conditionalValidators = [