This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: move to typescript
- Loading branch information
Showing
49 changed files
with
1,601 additions
and
1,358 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
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
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
|
||
# misc | ||
.DS_Store | ||
.vscode | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
|
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,24 @@ | ||
import { defineConfig } from 'cypress' | ||
|
||
export default defineConfig({ | ||
video: false, | ||
e2e: { | ||
// We've imported your old cypress plugins here. | ||
// You may want to clean this up later by importing these. | ||
setupNodeEvents(on, config) { | ||
// `on` is used to hook into various events Cypress emits | ||
// `config` is the resolved Cypress config | ||
|
||
const newConfig = { | ||
...config, | ||
env: { | ||
API_HOST: process.env.REACT_APP_API_HOST, | ||
}, | ||
}; | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('@cypress/code-coverage/task')(on, newConfig); | ||
return newConfig; | ||
}, | ||
baseUrl: 'http://localhost:3001', | ||
}, | ||
}) |
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
import { SIGN_IN_PATH } from '../../src/config/paths'; | ||
import { MEMBERS } from '../fixtures/members'; | ||
|
||
describe('Name and Email Validation', () => { | ||
it('Sign In', () => { | ||
const { GRAASP, WRONG_EMAIL } = MEMBERS; | ||
cy.visit(SIGN_IN_PATH); | ||
// Signing in with a wrong email format | ||
cy.signInAndCheck(WRONG_EMAIL); | ||
// Siging in with a valid email | ||
cy.signInAndCheck(GRAASP); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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 |
---|---|---|
@@ -1,4 +1,12 @@ | ||
export const MEMBERS = { | ||
import { Member, MemberType } from '@graasp/sdk'; | ||
|
||
export const MEMBERS: { | ||
[name: string]: Member & { | ||
nameValid?: boolean; | ||
emailValid?: boolean; | ||
passwordValid?: boolean; | ||
}; | ||
} = { | ||
GRAASP: { | ||
id: 'graasp-id', | ||
name: 'graasp', | ||
|
@@ -7,13 +15,22 @@ export const MEMBERS = { | |
nameValid: true, | ||
emailValid: true, | ||
passwordValid: true, | ||
type: MemberType.Individual, | ||
createdAt: new Date().toISOString(), | ||
updatedAt: new Date().toISOString(), | ||
extra: {}, | ||
}, | ||
WRONG_NAME: { | ||
id: 'id1', | ||
name: 'w', | ||
email: '[email protected]', | ||
nameValid: false, | ||
emailValid: true, | ||
passwordValid: false, | ||
type: MemberType.Individual, | ||
createdAt: new Date().toISOString(), | ||
updatedAt: new Date().toISOString(), | ||
extra: {}, | ||
}, | ||
WRONG_EMAIL: { | ||
id: 'id2', | ||
|
@@ -23,6 +40,10 @@ export const MEMBERS = { | |
nameValid: true, | ||
emailValid: false, | ||
passwordValid: true, | ||
type: MemberType.Individual, | ||
createdAt: new Date().toISOString(), | ||
updatedAt: new Date().toISOString(), | ||
extra: {}, | ||
}, | ||
WRONG_PASSWORD: { | ||
id: 'id3', | ||
|
@@ -32,29 +53,42 @@ export const MEMBERS = { | |
nameValid: true, | ||
emailValid: true, | ||
passwordValid: false, | ||
type: MemberType.Individual, | ||
createdAt: new Date().toISOString(), | ||
updatedAt: new Date().toISOString(), | ||
extra: {}, | ||
}, | ||
BOB: { | ||
id: 'ecafbd2a-5642-31fb-ae93-0242ac130004', | ||
name: 'bob', | ||
email: '[email protected]', | ||
createdAt: '2021-04-13 14:56:34.749946', | ||
extra: { lang: 'en' }, | ||
type: MemberType.Individual, | ||
updatedAt: new Date().toISOString(), | ||
}, | ||
CEDRIC: { | ||
id: 'ecafbd2a-5642-31fb-ae93-0242ac130006', | ||
name: 'cedric', | ||
email: '[email protected]', | ||
createdAt: '2021-04-13 14:56:34.749946', | ||
type: MemberType.Individual, | ||
updatedAt: new Date().toISOString(), | ||
extra: {}, | ||
}, | ||
}; | ||
|
||
export default MEMBERS; | ||
|
||
export const MOCK_SESSIONS = [ | ||
{ id: MEMBERS.BOB.id, token: 'bob-token', createdAt: Date.now() }, | ||
{ | ||
id: MEMBERS.BOB.id, | ||
token: 'bob-token', | ||
createdAt: Date.now().toLocaleString(), | ||
}, | ||
{ | ||
id: MEMBERS.CEDRIC.id, | ||
token: 'cedric-token', | ||
createdAt: Date.now(), | ||
createdAt: Date.now().toLocaleString(), | ||
}, | ||
]; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.