Skip to content

Commit

Permalink
Fix relative urls in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erikguntner committed Apr 4, 2024
1 parent 7aafe6e commit c7deb3c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('<GuestInviteButton />', () => {
const message = 'There was an error sending the invite.';

server.use(
http.post(`${import.meta.env.VITE_HUU_API_BASE_URL}/auth/invite`, () => {
http.post('/api/auth/invite', () => {
return HttpResponse.json(
{
message,
Expand Down
4 changes: 2 additions & 2 deletions app/src/utils/test/handlers/auth.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {http, HttpResponse} from 'msw';

export const handlers = [
http.post('/auth/forgot_password', () => {
http.post('/api/auth/forgot_password', () => {
return new HttpResponse();
}),
http.post('/auth/invite', () => {
http.post('/api/auth/invite', () => {
return new HttpResponse();
}),
];
19 changes: 8 additions & 11 deletions app/src/views/__tests__/ForgotPasswordCode.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,14 @@ describe('ForgotPasswordCode page', () => {
});
test('display an error message', async () => {
server.use(
http.post(
`${import.meta.env.VITE_HUU_API_BASE_URL}/auth/forgot_password`,
() => {
return HttpResponse.json(
{
message: 'Invalid email address',
},
{status: 400},
);
},
),
http.post('/api/auth/forgot_password', () => {
return HttpResponse.json(
{
message: 'Invalid email address',
},
{status: 400},
);
}),
);

setup();
Expand Down

0 comments on commit c7deb3c

Please sign in to comment.