Skip to content

Commit

Permalink
Update src/app/base/components/TagSelector/TagSelector.test.tsx
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Makowski <me+github@petermakowski.io>
  • Loading branch information
Jay-Topher and petermakowski committed Apr 8, 2024
1 parent 934a1a3 commit e24294e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/app/base/components/TagSelector/TagSelector.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,7 @@ describe("TagSelector", () => {
"new-tag"
);
await userEvent.click(screen.getByTestId("new-tag"));
expect(onAddNewTag).toHaveBeenCalledWith(
"new-tag",
expect.objectContaining({ type: "click", _reactName: "onClick" })
);
expect(onAddNewTag).toHaveBeenCalledWith("new-tag");

Check failure on line 182 in src/app/base/components/TagSelector/TagSelector.test.tsx

View workflow job for this annotation

GitHub Actions / Test

src/app/base/components/TagSelector/TagSelector.test.tsx > TagSelector > can call a provide function to create a new tag

AssertionError: expected "spy" to be called with arguments: [ 'new-tag' ] Received: 1st spy call: Array [ "new-tag", + SyntheticBaseEvent { + "_reactName": "onClick", + "_targetInst": null, + "altKey": false, + "bubbles": true, + "button": 0, + "buttons": 0, + "cancelable": true, + "clientX": 0, + "clientY": 0, + "ctrlKey": false, + "currentTarget": null, + "defaultPrevented": false, + "detail": 1, + "eventPhase": 3, + "getModifierState": [Function modifierStateGetter], + "isDefaultPrevented": [Function functionThatReturnsFalse], + "isPropagationStopped": [Function functionThatReturnsFalse], + "isTrusted": false, + "metaKey": false, + "movementX": 0, + "movementY": 0, + "nativeEvent": PointerEvent { + "isTrusted": false, + }, + "pageX": 0, + "pageY": 0, + "relatedTarget": null, + "screenX": 0, + "screenY": 0, + "shiftKey": false, + "target": <button + class="p-button--base tag-selector__dropdown-button u-break-word" + data-testid="new-tag" + type="button" + > + <em> + Create tag " + new-tag + " + </em> + </button>, + "timeStamp": 1712578837396, + "type": "click", + "view": null, + }, ] Number of calls: 1 ❯ src/app/base/components/TagSelector/TagSelector.test.tsx:182:25
// The input should get cleared.
expect(screen.getByRole("textbox", { name: "Tags" })).toHaveValue("");
});
Expand Down

0 comments on commit e24294e

Please sign in to comment.