fix(striker-ui): expose isRequired in build test batch functions

main
Tsu-ba-me 2 years ago
parent 1548bfd8bc
commit 37972bb557
  1. 3
      striker-ui/lib/test_input/buildDomainTestBatch.tsx
  2. 3
      striker-ui/lib/test_input/buildIPAddressTestBatch.tsx
  3. 3
      striker-ui/lib/test_input/buildNumberTestBatch.tsx
  4. 3
      striker-ui/lib/test_input/buildPeacefulStringTestBatch.tsx
  5. 3
      striker-ui/lib/test_input/buildUUIDTestBatch.tsx
  6. 3
      striker-ui/types/TestInputFunction.d.ts

@ -6,10 +6,11 @@ import { InlineMonoText } from '../../components/Text';
const buildDomainTestBatch: BuildInputTestBatchFunction = (
inputName,
onSuccess,
{ onFinishBatch, ...defaults } = {},
{ isRequired, onFinishBatch, ...defaults } = {},
onDomainTestFailure,
) => ({
defaults: { ...defaults, onSuccess },
isRequired,
onFinishBatch,
tests: [
{

@ -5,10 +5,11 @@ import testNotBlank from './testNotBlank';
const buildIPAddressTestBatch: BuildInputTestBatchFunction = (
inputName,
onSuccess,
{ onFinishBatch, ...defaults } = {},
{ isRequired, onFinishBatch, ...defaults } = {},
onIPv4TestFailure,
) => ({
defaults: { ...defaults, onSuccess },
isRequired,
onFinishBatch,
tests: [
{

@ -4,7 +4,7 @@ import toNumber from '../toNumber';
const buildNumberTestBatch: BuildInputTestBatchFunction = (
inputName,
onSuccess,
{ onFinishBatch, ...defaults } = {},
{ isRequired, onFinishBatch, ...defaults } = {},
onIntTestFailure?,
onFloatTestFailure?,
onRangeTestFailure?,
@ -48,6 +48,7 @@ const buildNumberTestBatch: BuildInputTestBatchFunction = (
return {
defaults: { ...defaults, onSuccess },
isRequired,
onFinishBatch,
tests,
};

@ -6,10 +6,11 @@ import { InlineMonoText } from '../../components/Text';
const buildPeacefulStringTestBatch: BuildInputTestBatchFunction = (
inputName,
onSuccess,
{ onFinishBatch, ...defaults } = {},
{ isRequired, onFinishBatch, ...defaults } = {},
onTestPeacefulStringFailureAppend,
) => ({
defaults: { ...defaults, onSuccess },
isRequired,
onFinishBatch,
tests: [
{

@ -5,10 +5,11 @@ import testNotBlank from './testNotBlank';
const buildUUIDTestBatch: BuildInputTestBatchFunction = (
inputName,
onSuccess,
{ onFinishBatch, ...defaults } = {},
{ isRequired, onFinishBatch, ...defaults } = {},
onUUIDTestFailure,
) => ({
defaults: { ...defaults, onSuccess },
isRequired,
onFinishBatch,
tests: [
{

@ -65,7 +65,8 @@ type InputTestBatch = {
type BuildInputTestBatchFunction = (
inputName: string,
onSuccess: InputTestSuccessCallback,
options?: InputTestBatch['defaults'] & Pick<InputTestBatch, 'onFinishBatch'>,
options?: InputTestBatch['defaults'] &
Pick<InputTestBatch, 'isRequired' | 'onFinishBatch'>,
...onFailureAppends: InputTestFailureAppendCallback[]
) => InputTestBatch;

Loading…
Cancel
Save