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

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

Loading…
Cancel
Save