fix(striker-ui): add compare value to input test variables

main
Tsu-ba-me 2 years ago
parent 8a8b3d798f
commit 807af8d7b0
  1. 4
      striker-ui/lib/test_input/testInput.ts
  2. 1
      striker-ui/types/TestInputFunction.ts

@ -49,6 +49,7 @@ const testInput: TestInputFunction = ({
Object.keys(testsToRun).every((id: string) => { Object.keys(testsToRun).every((id: string) => {
const { const {
defaults: { defaults: {
compare: dCompare = null,
displayMax: dDisplayMax, displayMax: dDisplayMax,
displayMin: dDisplayMin, displayMin: dDisplayMin,
max: dMax = 0, max: dMax = 0,
@ -61,6 +62,7 @@ const testInput: TestInputFunction = ({
tests: requiredTests, tests: requiredTests,
} = tests[id]; } = tests[id];
const { const {
compare = dCompare,
max = dMax, max = dMax,
min = dMin, min = dMin,
value = dValue, value = dValue,
@ -75,7 +77,7 @@ const testInput: TestInputFunction = ({
onSuccess = dOnSuccess, onSuccess = dOnSuccess,
test, test,
}) => { }) => {
const singleResult: boolean = test({ max, min, value }); const singleResult: boolean = test({ compare, max, min, value });
const { cbFailure, cbSuccess } = setSingleCallback({ const { cbFailure, cbSuccess } = setSingleCallback({
onFailure, onFailure,

@ -1,4 +1,5 @@
export type InputTestArgs = { export type InputTestArgs = {
compare?: InputTestArgs['value'];
displayMax?: string; displayMax?: string;
displayMin?: string; displayMin?: string;
max?: bigint | number; max?: bigint | number;

Loading…
Cancel
Save