EDIT: I figured it out in branch group25-patch-tests. Issue will close once branch is merged.
In App.test.js:
test('renders feedback', () => {
render(<Feedback />, {wrapper: MemoryRouter})
// TODO: FIX. Should be /Search Features.../i instead. Need to handle router memory.
const searchfeatures = screen.getByPlaceholderText(/Discover Projects.../i); // check search box text
const commstr = screen.getByText(/Leave a comment in the box below/i);
const patient = screen.getByText(/May take some time to load, please be patient!/i);
expect(commstr).toBeInTheDocument();
expect(patient).toBeInTheDocument();
})
As it stands, this test does currently pass. However, after the user navigates from any page to the Feedback page, the default text in the search bar should be "Search Features..." and not "Discover Projects...", which should only appear on the Home page.
I've tried using MemoryRouter with an Enzyme mount and initial entries, but I kept getting type errors.
createMemoryHistory also didn't work.
I suspect this has something to do with BrowserRouter being imported in App.js, but I could be wrong.
I don't know javascript so if someone could figure this out, that would be fantastic.
EDIT: I figured it out in branch group25-patch-tests. Issue will close once branch is merged.
In App.test.js:
As it stands, this test does currently pass. However, after the user navigates from any page to the Feedback page, the default text in the search bar should be "Search Features..." and not "Discover Projects...", which should only appear on the Home page.
I've tried using MemoryRouter with an Enzyme mount and initial entries, but I kept getting type errors.
createMemoryHistory also didn't work.
I suspect this has something to do with BrowserRouter being imported in App.js, but I could be wrong.
I don't know javascript so if someone could figure this out, that would be fantastic.