Mapping the filters
query param to the search feature
We need to write code to turn filters=id:[id1,id2,id3,id4]
into the format the search feature understands.
The current format looks like this:
And the end format will look like this:
This text above is a search filter string. When executed as part of a search, it retrieves any page that matches any condition where id equals one of those ids.
I'll start by defining a function in typescript to accomplish this behavior. We'll fill in the function body later.
This function was developed using Test Driven Development, or TDD.
We will follow the same process to explain the code.
We'll start with some jest
specs.