Skip to content

Commit

Permalink
Merge pull request #291 from GSA/wwang/code-refactoring
Browse files Browse the repository at this point in the history
merge from feature branch to dev for verifying backend changes
  • Loading branch information
weiwang-gsa authored Aug 17, 2023
2 parents 61a853c + 7908a96 commit 6f9231b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions training-front-end/src/components/AdminSearchUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
async function search() {
noResults.value = false
const url = new URL(`${report_url}${searchTerm.value}`)
url.search = new URLSearchParams({page_number: currentPage.value + 1})
const url = new URL(`${report_url}`)
url.search = new URLSearchParams({name: searchTerm.value, page_number: currentPage.value + 1})
try {
const response = await fetch(
url, {
Expand Down Expand Up @@ -64,7 +65,7 @@
try {
const response = await fetch(
url, {
method: "PUT",
method: "PATCH",
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${user.value.jwt}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('AdminAgencySelect', async () => {

expect(updateFetchSpy).nthCalledWith(1, expect.any(URL), {
body: '[10]',
method: 'PUT',
method: 'PATCH',
headers: {
'Authorization': 'Bearer some-token-value',
'Content-Type': 'application/json'
Expand Down Expand Up @@ -118,7 +118,7 @@ describe('AdminAgencySelect', async () => {
linkElements[1].trigger('click')

expect(fetchSpy).toBeCalledTimes(2)
expect(fetchSpy.mock.lastCall[0].search).toBe('?page_number=2')
expect(fetchSpy.mock.lastCall[0].search).toBe('?name=Steeply&page_number=2')
})

it('displays no results message', async () => {
Expand Down

0 comments on commit 6f9231b

Please sign in to comment.