-
Notifications
You must be signed in to change notification settings - Fork 13
Conversation
I wrote wrong commit msg. |
@dojutsu-user this is now conflicting with the recent merge. |
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.
The search keeps existing GET arguments in the URL ?foo=bar
, but it loses page-level extension data (#link-to-section
). I don't know if this is a big issue, but worth noting.
let path = window.location.pathname; | ||
let url_params = $.getQueryParameters(); | ||
|
||
if (_is_string(SEARCH_QUERY)) { |
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.
This could probably use a comment. When will it not be a string?
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.
This will always be a string. It will become false if SEARCH_QUERY
becomes empty string.
_is_string
func checks two things:
- The type of the data
- if the type is 'string', then it should be of length >= 1
search_outer_wrapper.is_displayed() is True | ||
), 'search modal should displayed when the page loads' | ||
assert ( | ||
search_result_box.text == 'Error Occurred. Please try again.' |
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.
Why does this show an 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.
Because the ajax func is overwritten to return an error here - https://github.com/readthedocs/readthedocs-sphinx-search/pull/25/files#diff-42e9264de947b8999fda83bf2bacd290R610
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 there a reason we're testing for an error when we're just trying to see if it shows up?
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.
I guess we have to test for something :)
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.
There's no particual reason -- I just wanted to test that modal shouldn't be empty after page is loaded and modal is shown.
It also proves that a jquery ajax request was there.
Ohh.. I think we should preserve that also. |
@ericholscher |
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.
This looks good to me. 👍
No description provided.