Skip to content

Commit

Permalink
feat: replace window.location with window.origin
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Nov 25, 2024
1 parent 562d37e commit 08547bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ describe('SidebarComponent', () => {
ok: true,
} as Response)

const originalUrl = window.location.href
const originalUrl = window.origin

await component.logOut()

expect(window.fetch).toHaveBeenCalledWith(service.logoutUrl, {
method: 'GET',
})
expect(window.location.href).toBe(originalUrl)
expect(window.location.href.slice(0, -1)).toBe(originalUrl)
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class SidebarComponent implements OnInit {
}

logOut() {
const current_url = window.location.toString()
const current_url = window.origin.toString()
fetch(this.authService.logoutUrl, {
method: 'GET',
})
Expand Down

0 comments on commit 08547bb

Please sign in to comment.