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

Remove typescript errors #817

Merged
merged 44 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
eedf716
Fixed imports, removed type validation for date
johnwroge Oct 6, 2024
1e6ef23
Fixed imports, removed type validation for date
johnwroge Oct 6, 2024
1984f6a
Removed packagelock.json
johnwroge Oct 7, 2024
ad82d8f
Npm install
johnwroge Oct 7, 2024
7eb65a2
Updated run tests file
johnwroge Oct 7, 2024
4b2c008
Update frontend package lock
paulespinosa Oct 7, 2024
913ecb4
Update frontend package lock
paulespinosa Oct 7, 2024
c17a770
Fixed signupform tests
johnwroge Oct 8, 2024
1362ae9
Update package lock
paulespinosa Oct 7, 2024
522c2dc
Update package lock
paulespinosa Oct 7, 2024
9cfcff3
Fixed resend code success message test
johnwroge Oct 15, 2024
31a181e
Fixed Imports
johnwroge Oct 15, 2024
d91aa8d
Fix display error message in forgot password code test
johnwroge Oct 15, 2024
9835116
Fix run tests yml file with new cypress port
johnwroge Oct 15, 2024
91db276
Updated cypress paths and auth endpoint
johnwroge Oct 15, 2024
fa9f174
Merge branch 'main' into remove_typescript_errors
paulespinosa Oct 15, 2024
8688ea1
Removed comments
johnwroge Oct 15, 2024
a8ffa0d
Update cypress e2e authentication test
paulespinosa Oct 16, 2024
111e219
Add role
johnwroge Oct 18, 2024
868dcdf
Update signup cypress test
johnwroge Oct 18, 2024
875e002
Changes to auth
johnwroge Oct 18, 2024
9b86c3e
Updated file changes
johnwroge Oct 18, 2024
cc8fe2f
Update port used by frontend for development to 4040
paulespinosa Oct 19, 2024
4f1c627
Merge branch 'main' into remove_typescript_errors
paulespinosa Oct 19, 2024
c98c301
Update README with port 4040 used for frontend dev and testing
paulespinosa Oct 19, 2024
f3e3e32
Update packages
erikguntner Oct 23, 2024
c347333
Merge branch 'remove_typescript_errors' of https://github.com/hackfor…
erikguntner Oct 23, 2024
0b5e11a
Added error handling to main.tsx for cypress tests
johnwroge Oct 24, 2024
7a80dae
Remove comments
johnwroge Oct 24, 2024
ffecfd5
Added run command to backend readme and 404 page for frontend
johnwroge Oct 24, 2024
47339fa
Debugging api tests
johnwroge Oct 24, 2024
b3e22db
Debugging api tests
johnwroge Oct 24, 2024
4c2570c
changing github actions file
johnwroge Oct 24, 2024
8689079
reverting changes to runtestv1.yml
johnwroge Oct 24, 2024
4a7142c
sync querys
erikguntner Oct 24, 2024
39e92a9
Merge branch 'remove_typescript_errors' of https://github.com/hackfor…
erikguntner Oct 24, 2024
f2c0801
Updated authentication test
johnwroge Oct 30, 2024
88aff7e
remove error message test
johnwroge Oct 30, 2024
4fe0139
add log to failing test
johnwroge Oct 30, 2024
c2ec972
Update failing tests
johnwroge Oct 30, 2024
78ceee4
Update failing tests
johnwroge Oct 30, 2024
a7e6686
Update failing tests
johnwroge Oct 30, 2024
49700e7
Update failing tests
johnwroge Oct 30, 2024
c2bae7e
Update failing tests
johnwroge Oct 30, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/run-tests-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
echo "COGNITO_REGION set"
tox -e releasetest
test-app:
test-frontend:
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -63,4 +63,4 @@ jobs:
install: false
start: npm run dev
working-directory: ./frontend
wait-on: "http://[::1]:4040/"
wait-on: "http://[::1]:34828/"
3 changes: 2 additions & 1 deletion backend/startup_scripts/setup_moto_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def create(self):
region_name="us-east-1",
aws_access_key_id="testing",
aws_secret_access_key="testing",
endpoint_url=os.environ['COGNITO_ENDPOINT_URL'])
# endpoint_url=os.environ['COGNITO_ENDPOINT_URL']
johnwroge marked this conversation as resolved.
Show resolved Hide resolved
)

# Only create a user pool and test data if one does not already exist
pools = cognito_client.list_user_pools(MaxResults=5)
Expand Down
1 change: 1 addition & 0 deletions backend/tests/test_alembic_migration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from app.user_roles import UserRole

from app.repositories.user_repo import UserRepository

# Importing these tests will register them within our test project
Expand Down
2 changes: 1 addition & 1 deletion frontend/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {defineConfig} from 'cypress';

export default defineConfig({
e2e: {
baseUrl: 'http://localhost:4040',
baseUrl: 'http://localhost:34828',
},
component: {
devServer: {
Expand Down
4 changes: 2 additions & 2 deletions frontend/cypress/e2e/forgot-password.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
describe('Forgot Password', () => {
beforeEach(() => {
cy.intercept('POST', '/api/auth/forgot_password', {statusCode: 200}).as(
cy.intercept('POST', '/api/auth/forgot-password', {statusCode: 200}).as(
'forgotPassword',
);

cy.intercept('POST', '/api/auth/forgot_password/confirm', {
cy.intercept('POST', '/api/auth/forgot-password/confirm', {
statusCode: 200,
}).as('forgotPasswordConfirm');
});
Expand Down
31 changes: 19 additions & 12 deletions frontend/cypress/e2e/sign-up.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,33 @@ describe('Sign Up', () => {
beforeEach(() => {
if (Cypress.env('USE_MOCK')) {
// While Mocking always return a successful status code
cy.intercept('POST', '/api/auth/signup/coordinator', {
cy.intercept('POST', '/api/auth/signup', {
statusCode: 200,
}).as('signUpCoordinator');

cy.intercept('POST', '/api/auth/signup/host', {statusCode: 200}).as(
'signUpHost',
);
}).as('signUp');
} else {
// cy.intercept without a request will not stub out the real API call
cy.intercept('POST', '/api/auth/signup/coordinator').as(
'signUpCoordinator',
);
cy.intercept('POST', '/api/auth/signup/host').as('signUpHost');
cy.intercept('POST', '/api/auth/signup').as('signUp');
}

cy.intercept('GET', '/api/auth/session', req => {
req.reply({
statusCode: 401,
});
}).as('session');

cy.intercept('GET', '/api/auth/refresh', req => {
req.reply({
statusCode: 401,
});
}).as('refresh');
});

it('user can sign up as a coordinator', () => {
const user = {
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
email: faker.internet.email(),
role: 'host',
johnwroge marked this conversation as resolved.
Show resolved Hide resolved
password: 'Test123!',
};

Expand Down Expand Up @@ -62,6 +68,7 @@ describe('Sign Up', () => {
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
email: faker.internet.email(),
role: 'host',
password: 'Test123!',
};

Expand All @@ -75,7 +82,7 @@ describe('Sign Up', () => {
.should('be.enabled')
.click();

cy.url().should('include', '/signup/host');
cy.url().should('include', '/signup');

cy.findByRole('button', {name: /sign up/i}).should('be.disabled');

Expand All @@ -87,7 +94,7 @@ describe('Sign Up', () => {
.should('be.enabled')
.click();

cy.wait('@signUpHost').its('request.body').should('deep.equal', user);
cy.wait('@signUp').its('request.body').should('deep.equal', user);

cy.url().should('include', `signup/success?email=${user.email}`);
});
Expand Down
8 changes: 5 additions & 3 deletions frontend/cypress/e2e/test-authentication.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ describe('Authentication', () => {
email: '[email protected]',
firstName: 'Test',
lastName: 'User',
id: 2,
role: {
name: 'Guest',
id: 2,
type: 'guest',
},
},
}
Expand All @@ -82,7 +84,7 @@ describe('Authentication', () => {
statusCode: getIsSignedIn() ? 200 : 401,
});
}).as('refresh');
cy.intercept('GET', '/api/auth/user', {
cy.intercept('GET', '/api/users/current', {
statusCode: 200,
body: {
token: 'fake.jwt.token',
Expand All @@ -96,7 +98,7 @@ describe('Authentication', () => {
cy.intercept('POST', '/api/auth/signout').as('signout');
cy.intercept('GET', '/api/auth/session').as('session');
cy.intercept('GET', '/api/auth/refresh').as('refresh');
cy.intercept('GET', '/api/auth/user').as('user');
cy.intercept('GET', '/api/users/current').as('user');
}
});

Expand Down
Loading
Loading