Ticket "Text and Subfield Search": Test passed, UI-Status fails

I implemented the search functionality as specified, at least I hope so :wink:

After running the test (see below) everything seems to be fine but the output in the Status-UI states the following:

Text and Subfield Search: Did not receive the proper response when searching by genre

I would have expected test and UI should report the same, do you have a hint for me?

It is not due to a caching issue because I let another test fail which was immediately reflected by the test AND the UI.

--------------------- 8< ------------------

npm test text-subfield

server@1.0.0 test /Users/Oliver/Dev/mongodb-university/m220/mflix-js
jest --passWithNoTests “text-subfield”

Determining test suites to run…Setup Mongo Connection
PASS test/text-subfield.test.js
Text and Subfield Search
✓ Can perform a text search (124ms)
✓ Can perform a genre search with one genre (100ms)
✓ Can perform a genre search with multiple genres (72ms)
✓ Can perform a cast search with one cast member (218ms)
✓ Can perform a cast search with multiple cast members (122ms)
✓ Can perform a search and return a non-default number of movies per page (127ms)

Test Suites: 1 passed, 1 total
Tests: 6 passed, 6 total
Snapshots: 0 total
Time: 1.82s, estimated 2s
Ran all test suites matching /text-subfield/i.
Teardown Mongo Connection

Hmm Strange :thinking:. Try restarting the server and check again in the incognito tab. Also try manually searching by genre and see if its working fine.


Thanks for the hint, when I manually searched an error was shown at the command line.

In the end the problem was a combination of a programming-error from my side and a gap in the test-case.

Gap-Description: The test-case passes an array when testing only ONE genre opposed to the UI which passes a string.

1 Like

I am glad you’ve figured it out. BTW they’ve provided code to change a string to an array in the genreSearchQuery() function.

Got the same issue, checked the error and fix it. Thanks for the hints

Amm whats the real issue? I started in incognito and still facing the same issue

Hi @iamodane,

Please let us know if you are still facing the issue.


No I fixed the issue

Just a note in case someone else misses it: there is a searchGenre variable to be used to avoid the issue Dharma mentioned. Without it, your tests will pass but the status UI will fail.


I have same issue, test is ok, but GUI gives error. I couldn’t find a solution from the discussion area and I don’t want ruin code with my modifications. Can somebody give a tip how to solve this?

Test is OK

UI Test is NOT OK
Server side

I use Array to fetch data in filter.