-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5eb7795
commit fde2854
Showing
5 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,16 @@ describe('Login Page', () => { | |
cy.fixture('accounts').then(({ standard }) => { | ||
const { email, password } = standard; | ||
|
||
cy.fixture('acmAuthResponse').then(({ authAdmin }) => { | ||
cy.intercept('POST', 'login', authAdmin).as('authAdminGood'); | ||
}); | ||
|
||
cy.fixture('acmStandardProfile').then(standardProfile => { | ||
cy.intercept('GET', 'user', standardProfile).as('adminProfile'); | ||
}); | ||
|
||
cy.log('Logging in with email:', email); | ||
|
||
cy.get('input[name="email"]').type(email); | ||
cy.get('input[name="password"]').type(password); | ||
cy.get('button').contains('Sign In').click(); | ||
|
@@ -22,6 +32,14 @@ describe('Login Page', () => { | |
cy.fixture('accounts').then(({ admin }) => { | ||
const { email, password } = admin; | ||
|
||
cy.fixture('acmAuthResponse').then(({ authAdmin }) => { | ||
cy.intercept('POST', 'login', authAdmin).as('authAdminGood'); | ||
}); | ||
|
||
cy.fixture('acmAdminProfile').then(adminProfile => { | ||
cy.intercept('GET', 'user', adminProfile).as('adminProfile'); | ||
}); | ||
|
||
cy.get('input[name="email"]').type(email); | ||
cy.get('input[name="password"]').type(password); | ||
cy.get('button').contains('Sign In').click(); | ||
|
@@ -33,6 +51,10 @@ describe('Login Page', () => { | |
}); | ||
|
||
it('Should fail with invalid credentials', () => { | ||
cy.fixture('acmAuthResponseBadPassword').then(({ authAdminBad }) => { | ||
cy.intercept('POST', 'login', authAdminBad).as('authAdminBad'); | ||
}); | ||
|
||
const [email, password] = ['[email protected]', 'abc']; | ||
|
||
cy.get('input[name="email"]').type(email); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"error": null, | ||
"user": { | ||
"uuid": "043fa366-d893-4e54-a6c9-ae8c40df6f0f", | ||
"handle": "acmucsd", | ||
"email": "[email protected]", | ||
"firstName": "Barthomelow", | ||
"lastName": "Admin", | ||
"profilePicture": "https://acmucsd-membership-portal.s3.us-west-1.amazonaws.com/portal/profiles/043fa366-d893-4e54-a6c9-ae8c40df6f0f", | ||
"accessType": "ADMIN", | ||
"state": "PASSWORD_RESET", | ||
"graduationYear": 2029, | ||
"major": "Business Psychology", | ||
"bio": "I am ACM Admin 💪\nHello\nI have a really long bio! \nI have a really long bio! \nI have a really long bio! \nI have a really long bio! \nI have a really long bio! yoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo", | ||
"points": 100833, | ||
"credits": 3127242, | ||
"isAttendancePublic": false, | ||
"resumes": [], | ||
"userSocialMedia": [ | ||
{ | ||
"uuid": "02865e2c-649a-4e67-901d-f93982e11f8c", | ||
"type": "EMAIL", | ||
"url": "[email protected]" | ||
}, | ||
{ | ||
"uuid": "50e96105-1185-4fc9-8c67-41bdb5d535d3", | ||
"type": "DEVPOST", | ||
"url": "https://devpost.com/sadf" | ||
}, | ||
{ | ||
"uuid": "a7774068-03f7-4cc1-ac9c-73213dcf69b3", | ||
"type": "FACEBOOK", | ||
"url": "https://facebook.com/sdf" | ||
}, | ||
{ | ||
"uuid": "35166c85-b1cf-4499-a58c-ba25624a5685", | ||
"type": "TWITTER", | ||
"url": "https://twitter.com/asdfs" | ||
}, | ||
{ | ||
"uuid": "bb02c4fe-1969-4ea5-a481-4552c50c2096", | ||
"type": "PORTFOLIO", | ||
"url": "https://hi.comasdfs" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"authAdmin": { | ||
"error": null, | ||
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1dWlkIjoiMDQzZmEzNjYtZDg5My00ZTU0LWE2YzktYWU4YzQwZGY2ZjBmIiwiYWRtaW4iOnRydWUsImlhdCI6MTcxNDg4ODQ3NiwiZXhwIjoxNzE2MDk4MDc2fQ.Y4jtIgFCMVlIaHM294kWNXvbGtI6yJgoqcEAwKgAG6I" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"authAdminBad": { | ||
"error": { | ||
"httpCode": 403, | ||
"name": "ForbiddenError", | ||
"message": "Incorrect password", | ||
"stack": "Error\n at new HttpError (/app/node_modules/routing-controllers/cjs/http-error/HttpError.js:17:22)\n at new ForbiddenError (/app/node_modules/routing-controllers/cjs/http-error/ForbiddenError.js:10:9)\n at UserAuthService.<anonymous> (/app/build/services/UserAuthService.js:158:27)\n at Generator.next (<anonymous>)\n at fulfilled (/app/build/services/UserAuthService.js:17:58)" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"error": null, | ||
"user": { | ||
"uuid": "8315405c-98a9-4f0f-9e8d-6b4871820e24", | ||
"handle": "geovany", | ||
"email": "[email protected]", | ||
"firstName": "John", | ||
"lastName": "Doe", | ||
"profilePicture": null, | ||
"accessType": "ADMIN", | ||
"state": "PASSWORD_RESET", | ||
"graduationYear": 2026, | ||
"major": "Computer Engineering", | ||
"bio": "I am a testing account.", | ||
"points": 10, | ||
"credits": 1000, | ||
"isAttendancePublic": true, | ||
"resumes": [ | ||
{ | ||
"uuid": "9b36daaa-7c91-42d4-97cc-cf2ecb58903f", | ||
"isResumeVisible": true, | ||
"url": "https://acmucsd-membership-portal.s3.us-west-1.amazonaws.com/portal/resumes/8315405c-98a9-4f0f-9e8d-6b4871820e24/Faris%20Ashai%20Resume.pdf", | ||
"lastUpdated": "2023-03-10T23:29:58.568Z" | ||
} | ||
], | ||
"userSocialMedia": [ | ||
{ | ||
"uuid": "6ef96ada-738b-4560-9838-0379cc114ac4", | ||
"type": "LINKEDIN", | ||
"url": "https://linkedin.com/in/asdf" | ||
} | ||
] | ||
} | ||
} |