-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WEBDEV-6909 Add radio search backend #54
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! nice and easily loaded in. thanks for the test suite! had questions,comments
window.history.replaceState({}, '', url.toString()); | ||
}); | ||
|
||
it('includes reCache param from URL if not provided', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('includes reCache param from URL if not provided', async () => { | |
it('includes reCache param from URL if provided', async () => { |
looks like recache is set in stub
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've rewritten the test descriptions to be clearer around this. "Provided" here was supposed to mean "provided as an option" which is now explicitly spelled out. The purpose of these tests is: if we don't receive a caching
option from the caller, check whether there is a cache directive in the URL and use that instead if so.
const response = await backend.performSearch({ query: 'foo' }); | ||
expect(response).to.exist; // No error thrown | ||
expect(response.error).to.be.instanceof(SearchServiceError); | ||
expect(response.error?.type).to.equal(SearchServiceErrorType.networkError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is network error the default error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in general, no. But in this test, we are mocking window.fetch
calls to return an error, which results in the networkError
code from the service.
async performSearch( | ||
params: SearchParams | ||
): Promise<Result<any, SearchServiceError>> { | ||
if (this.debuggingEnabled && params.debugging === undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do !params.debugging
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debugging
is allowed to be explicitly set to true
or false
on a search, which overrides any global default setting in the search service. So this line is just saying "if no debugging
value was provided as an option, use the default".
!params.debugging
would change the logic, as it would no longer be possible to override the default by providing false
.
noting build is failing |
2b4fec5
to
f8ec5ad
Compare
|
Build issues fixed -- the node version in our CI config was outdated. |
Adds a new search backend for requesting radio caption hits from the PPS, updating models to account for this new search type.