Skip to content
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

merge from feature branch to dev for verifying backend changes #291

Merged
merged 3 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading