Skip to content

Commit f83cfbf

Browse files
authored
Merge pull request #516 from hackforla/resend-code
Resend code from code submission page
2 parents 7af7496 + 7641142 commit f83cfbf

File tree

8 files changed

+291
-47
lines changed

8 files changed

+291
-47
lines changed

app/cypress/e2e/forgot-password.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('Forgot Password', () => {
3434
cy.wrap($el).type(`${code[index]}`);
3535
});
3636

37-
cy.findByRole('button', {name: /submit/i}).click();
37+
cy.findByRole('button', {name: /verify/i}).click();
3838

3939
cy.url().should('include', '/forgot-password/reset');
4040

app/package-lock.json

Lines changed: 163 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"ts-node": "^10.9.1",
7171
"typescript": "^4.7.4",
7272
"vite": "^3.2.5",
73-
"vitest": "^0.31.1"
73+
"vitest": "^0.31.1",
74+
"whatwg-fetch": "^3.6.2"
7475
}
7576
}

app/src/services/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {RootState} from '../app/store';
1010

1111
// Create base query
1212
const baseQuery = fetchBaseQuery({
13-
baseUrl: '/api/',
13+
baseUrl: 'http://localhost:4040/api/',
1414
prepareHeaders: (headers, {getState}) => {
1515
// get token from state
1616
const token = (getState() as RootState).auth.token;

app/src/utils/test/handlers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import {rest} from 'msw';
22

3+
const baseUrl = 'http://localhost:4040/api';
4+
35
const handlers = [
4-
rest.post(`/auth/forgot_password/confirm`, (req, res, ctx) => {
5-
console.log('reset password', req);
6+
rest.post(`${baseUrl}/auth/forgot_password`, (req, res, ctx) => {
67
return res(ctx.status(200));
78
}),
89
];

app/src/utils/test/setupTests.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Handle test setup here
22
import '@testing-library/jest-dom';
3+
import 'whatwg-fetch';
34
import {server} from './server';
45

56
beforeAll(() => server.listen({onUnhandledRequest: 'error'}));

0 commit comments

Comments
 (0)