Skip to content

Commit

Permalink
fix: APPS-2668 SearchHome.vue query param should be q (#507)
Browse files Browse the repository at this point in the history
fix: query param in searchhome

Co-authored-by: Jess Divers <[email protected]>
  • Loading branch information
farosFreed and Jess Divers authored May 9, 2024
1 parent 7d8e2dd commit 3ab4e57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib-components/SearchHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function doSearch() {
if (isSiteSearch.value) {
router.push({
path: actionUrl.value,
query: { [queryParam as any]: searchWords.value },
query: { [queryParam.value as string]: searchWords.value },
})
}
else {
Expand Down
7 changes: 7 additions & 0 deletions src/stories/SearchHome.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@ describe('Search / Search Home', () => {

cy.percySnapshot('Search / Home: Default')
})
it('uses q for query parameter', () => {
cy.visit('/iframe.html?id=search-search-home--default&args=&viewMode=story')
// click the library search tab, then submit empty search
cy.contains('button', 'Site Search').click()
cy.get('button[class="button-submit"]').click()
cy.url().should('include', '?q=')
})
})

2 comments on commit 3ab4e57

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.