Skip to content

Commit

Permalink
fix: update call params for add tag function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay-Topher committed Apr 8, 2024
1 parent e24294e commit bb09446
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const NodeConfigurationFields = (): JSX.Element => {
)}
externalSelectedTags={selectedTags}
name="tags"
onAddNewTag={(name, event) => {
onAddNewTag={(name) => (event) => {
setNewTagName(name);
openPortal(event);
}}
Expand Down
2 changes: 1 addition & 1 deletion src/app/base/components/TagSelector/TagSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const generateDropdownItems = ({
onClick={(e) => {
const cleanedFilter = sanitiseFilter(filter);
if (onAddNewTag) {
onAddNewTag(cleanedFilter.name, e);
onAddNewTag(cleanedFilter.name)(e);

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

View workflow job for this annotation

GitHub Actions / Test

Unhandled error

TypeError: onAddNewTag(...) is not a function ❯ onClick src/app/base/components/TagSelector/TagSelector.tsx:97:45 ❯ HTMLUnknownElement.callCallback node_modules/react-dom/cjs/react-dom.development.js:4164:14 ❯ HTMLUnknownElement.callTheUserObjectsOperation node_modules/jsdom/lib/jsdom/living/generated/EventListener.js:26:30 ❯ innerInvokeEventListeners node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:350:25 ❯ invokeEventListeners node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:286:3 ❯ HTMLUnknownElementImpl._dispatch node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:233:9 ❯ HTMLUnknownElementImpl.dispatchEvent node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:104:17 ❯ HTMLUnknownElement.dispatchEvent node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:241:34 ❯ Object.invokeGuardedCallbackDev node_modules/react-dom/cjs/react-dom.development.js:4213:16 ❯ invokeGuardedCallback node_modules/react-dom/cjs/react-dom.development.js:4277:31 This error originated in "src/app/base/components/TagSelector/TagSelector.test.tsx" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "can call a provide function to create a new tag". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.
setFilter("");
} else {
updateTags([...selectedTags, cleanedFilter]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const TagFormFields = ({
}
label={Label.TagInput}
name="added"
onAddNewTag={(name) => {
onAddNewTag={(name) => (_) => {
setNewTagName(name);
setSecondaryContent("addTag");
}}
Expand Down

0 comments on commit bb09446

Please sign in to comment.