Skip to content

Commit

Permalink
intentionally fail a unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
bdami-gavant committed Mar 19, 2024
1 parent 075cced commit 6ccc016
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('<MaskedSecureInput />', () => {
await userEvent.type(element, '123456789');
await userEvent.click(screen.getByText('Submit'));
expect(onSubmit).toHaveBeenCalledOnce();
expect(onSubmit).toHaveBeenCalledWith(expect.objectContaining({ ssn: '123456789' }), expect.anything());
expect(onSubmit).toHaveBeenCalledWith(expect.objectContaining({ ssn: '12345678' }), expect.anything());

Check failure on line 65 in src/components/MaskedSecureInput/MaskedSecureInput.test.tsx

View workflow job for this annotation

GitHub Actions / build (16.x)

src/components/MaskedSecureInput/MaskedSecureInput.test.tsx > <MaskedSecureInput /> > react-hook-form > should have inter-op with useForm()

AssertionError: expected "spy" to be called with arguments: [ ObjectContaining{…}, Anything ] Received: 1st spy call: Array [ - ObjectContaining { - "ssn": "12345678", + Object { + "ssn": "123456789", + }, + SyntheticBaseEvent { + "_reactName": "onSubmit", + "_targetInst": null, + "bubbles": true, + "cancelable": true, + "currentTarget": null, + "defaultPrevented": true, + "eventPhase": 3, + "isDefaultPrevented": [Function functionThatReturnsTrue], + "isPropagationStopped": [Function functionThatReturnsFalse], + "isTrusted": true, + "nativeEvent": SubmitEvent { + "isTrusted": true, + }, + "target": <form + novalidate="" + > + <div + class="MuiFormControl-root-cIviKq irijnr MuiFormControl-root MuiTextField-root-irieE MuiTextField-root" + inputmode="numeric" + > + <label + class="MuiFormLabel-root-JDKoj bogZUe MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiFormLabel-filled MuiInputLabel-root-iIigrT eiCHXa MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined" + data-shrink="true" + for=":r3:" + id=":r3:-label" + > + Label + </label> + <div + class="MuiInputBase-root-jxHnQA MuiOutlinedInput-root-hbWbhN eaHyhh ksgrTr MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-formControl" + > + <input + aria-invalid="false" + class="MuiInputBase-input-hgvIBM MuiOutlinedInput-input-gNAnCt gZFYRL jmGRjH MuiInputBase-input MuiOutlinedInput-input" + id=":r3:" + inputmode="numeric" + name="ssn" + type="password" + value="123-45-6789" + /> + <fieldset + aria-hidden="true" + class="sc-guDLey kBlroy MuiOutlinedInput-notchedOutline-TWKdE gRFrCv MuiOutlinedInput-notchedOutline" + > + <legend + class="sc-dmyCSP dTjiMB" + > + <span> + Label + </span> + </legend> + </fieldset> + </div> + </div> + <button + type="submit" + > + Submit + </button> + </form>, + "timeStamp": 1710871164214, + "type": "submit", }, - Anything, ] Number of calls: 1 ❯ src/components/MaskedSecureInput/MaskedSecureInput.test.tsx:65:30

Check failure on line 65 in src/components/MaskedSecureInput/MaskedSecureInput.test.tsx

View workflow job for this annotation

GitHub Actions / build (16.x)

src/components/MaskedSecureInput/MaskedSecureInput.test.tsx > <MaskedSecureInput /> > react-hook-form > should have inter-op with useForm()

AssertionError: expected "spy" to be called with arguments: [ ObjectContaining{…}, Anything ] Received: 1st spy call: Array [ - ObjectContaining { - "ssn": "12345678", + Object { + "ssn": "123456789", + }, + SyntheticBaseEvent { + "_reactName": "onSubmit", + "_targetInst": null, + "bubbles": true, + "cancelable": true, + "currentTarget": null, + "defaultPrevented": true, + "eventPhase": 3, + "isDefaultPrevented": [Function functionThatReturnsTrue], + "isPropagationStopped": [Function functionThatReturnsFalse], + "isTrusted": true, + "nativeEvent": SubmitEvent { + "isTrusted": true, + }, + "target": <form + novalidate="" + > + <div + class="MuiFormControl-root-cIviKq irijnr MuiFormControl-root MuiTextField-root-irieE MuiTextField-root" + inputmode="numeric" + > + <label + class="MuiFormLabel-root-JDKoj bogZUe MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiFormLabel-filled MuiInputLabel-root-iIigrT eiCHXa MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined" + data-shrink="true" + for=":r3:" + id=":r3:-label" + > + Label + </label> + <div + class="MuiInputBase-root-jxHnQA MuiOutlinedInput-root-hbWbhN eaHyhh ksgrTr MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-formControl" + > + <input + aria-invalid="false" + class="MuiInputBase-input-hgvIBM MuiOutlinedInput-input-gNAnCt gZFYRL jmGRjH MuiInputBase-input MuiOutlinedInput-input" + id=":r3:" + inputmode="numeric" + name="ssn" + type="password" + value="123-45-6789" + /> + <fieldset + aria-hidden="true" + class="sc-guDLey kBlroy MuiOutlinedInput-notchedOutline-TWKdE gRFrCv MuiOutlinedInput-notchedOutline" + > + <legend + class="sc-dmyCSP dTjiMB" + > + <span> + Label + </span> + </legend> + </fieldset> + </div> + </div> + <button + type="submit" + > + Submit + </button> + </form>, + "timeStamp": 1710871459658, + "type": "submit", }, - Anything, ] Number of calls: 1 ❯ src/components/MaskedSecureInput/MaskedSecureInput.test.tsx:65:30
});
});
});

0 comments on commit 6ccc016

Please sign in to comment.