diff --git a/client/techlog/src/Components/Search/SearchTags.js b/client/techlog/src/Components/Search/SearchTags.js index 4c558f9..620f7b3 100644 --- a/client/techlog/src/Components/Search/SearchTags.js +++ b/client/techlog/src/Components/Search/SearchTags.js @@ -6,8 +6,8 @@ const SearchTags = ({tag, deleteTagHandler}) => { return (
-
  • #{tag}
  • - +
  • #{tag}
  • + {/* */}
    ) } diff --git a/client/techlog/src/__tests__/SearchReport.test.js b/client/techlog/src/__tests__/SearchReport.test.js index a79df51..e34dad9 100644 --- a/client/techlog/src/__tests__/SearchReport.test.js +++ b/client/techlog/src/__tests__/SearchReport.test.js @@ -65,7 +65,30 @@ describe('Search Reports', () => { }); - - + it('Should remove a tag when clicked on', async () => { + const dummyReports = []; + + jest.spyOn(window, "fetch").mockImplementation(() => + Promise.resolve({ + json: () => Promise.resolve(dummyReports) + }) + ); + + await act(async () => { + render(); + }); + + const testTag = 'testTag'; + fireEvent.change(screen.getByRole('textbox'), { + target: { value: testTag } + }); + fireEvent.click(screen.getByRole('button', {name: 'ADD TAG'})); + const renderedTag = screen.getByText(/testTag/i); + fireEvent.click(renderedTag); + expect(renderedTag).not.toBeInTheDocument(); + + }); + }); + \ No newline at end of file