-
Notifications
You must be signed in to change notification settings - Fork 4
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
556030a
commit ed598c3
Showing
37 changed files
with
1,587 additions
and
164 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
build/ | ||
node_modules/ | ||
src/reportWebVitals.ts |
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 |
---|---|---|
|
@@ -26,4 +26,6 @@ yarn-error.log* | |
|
||
# Cypress | ||
cypress/screenshots | ||
cypress/videos | ||
cypress/videos | ||
|
||
.env.* |
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,66 @@ | ||
import { passwordValidatioError } from '../../src/app/types'; | ||
|
||
describe('Sign up screen', () => { | ||
beforeEach(() => { | ||
cy.visit('/sign-up'); | ||
}); | ||
|
||
it('should render components', () => { | ||
cy.get('input[id="email"]').should('exist'); | ||
cy.get('input[id="password"]').should('exist'); | ||
cy.get('input[id="confirmPassword"]').should('exist'); | ||
cy.get('button[id="sign-up-button"]').should('exist'); | ||
}); | ||
|
||
it('should show the password error when password length is less than 12', () => { | ||
cy.get('input[id="password"]') | ||
.should('exist') | ||
.type('short', { force: true }); | ||
|
||
cy.get('[data-testid=passwordError]') | ||
.should('exist') | ||
.contains(passwordValidatioError); | ||
}); | ||
|
||
it('should show the password error when password do not contain lowercase', () => { | ||
cy.get('input[id="password"]') | ||
.should('exist') | ||
.type('UPPERCASE_10_!', { force: true }); | ||
|
||
cy.get('[data-testid=passwordError]') | ||
.should('exist') | ||
.contains(passwordValidatioError); | ||
}); | ||
|
||
it('should show the password error when password do not contain uppercase', () => { | ||
cy.get('input[id="password"]') | ||
.should('exist') | ||
.type('lowercase_10_!', { force: true }); | ||
|
||
cy.get('[data-testid=passwordError]') | ||
.should('exist') | ||
.contains(passwordValidatioError); | ||
}); | ||
|
||
it('should not show the password error when password is valid', () => { | ||
cy.get('input[id="password"]') | ||
.should('exist') | ||
.type('UP_lowercase_10_!', { force: true }); | ||
|
||
cy.get('[data-testid=passwordError]').should('not.exist'); | ||
}); | ||
|
||
it('should show the password error when password do not match', () => { | ||
cy.get('input[id="password"]') | ||
.should('exist') | ||
.type('UP_lowercase_10_!', { force: true }); | ||
|
||
cy.get('input[id="confirmPassword"]') | ||
.should('exist') | ||
.type('UP_lowercase_11_!', { force: true }); | ||
|
||
cy.get('[data-testid=confirmPasswordError]') | ||
.should('exist') | ||
.contains('Passwords do not match'); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
DISABLE_ESLINT_PLUGIN=true | ||
REACT_APP_FIREBASE_API_KEY={{REACT_APP_FIREBASE_API_KEY}} | ||
REACT_APP_FIREBASE_AUTH_DOMAIN={{REACT_APP_FIREBASE_AUTH_DOMAIN}} | ||
REACT_APP_FIREBASE_PROJECT_ID={{REACT_APP_FIREBASE_PROJECT_ID}} | ||
REACT_APP_FIREBASE_STORAGE_BUCKET={{REACT_APP_FIREBASE_STORAGE_BUCKET}} | ||
REACT_APP_FIREBASE_MESSAGING_SENDER_ID={{REACT_APP_FIREBASE_MESSAGING_SENDER_ID}} | ||
REACT_APP_FIREBASE_APP_ID={{REACT_APP_FIREBASE_APP_ID}} |
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 @@ | ||
DISABLE_ESLINT_PLUGIN=true | ||
REACT_APP_FIREBASE_API_KEY="REACT_APP_FIREBASE_API_KEY" | ||
REACT_APP_FIREBASE_PROJECT_ID="REACT_APP_FIREBASE_PROJECT_ID" | ||
REACT_APP_FIREBASE_STORAGE_BUCKET="REACT_APP_FIREBASE_STORAGE_BUCKET" | ||
REACT_APP_FIREBASE_MESSAGING_SENDER_ID="REACT_APP_FIREBASE_MESSAGING_SENDER_ID" | ||
REACT_APP_FIREBASE_APP_ID="REACT_APP_FIREBASE_APP_ID" |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as React from 'react'; | ||
import type ContextProviderProps from '../interface/ContextProviderProps'; | ||
import LoadingOverlay from 'react-loading-overlay-ts'; | ||
import { useSelector } from 'react-redux'; | ||
import { selectLoadingApp } from '../store/selectors'; | ||
|
||
/** | ||
* This adds a spinner to the entire application | ||
*/ | ||
const AppSpinner: React.FC<ContextProviderProps> = ({ children }) => { | ||
const isActive = useSelector(selectLoadingApp); | ||
return ( | ||
<LoadingOverlay active={isActive} spinner> | ||
{children} | ||
</LoadingOverlay> | ||
); | ||
}; | ||
|
||
export default AppSpinner; |
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,40 @@ | ||
import React, { useEffect } from 'react'; | ||
import type ContextProviderProps from '../interface/ContextProviderProps'; | ||
import { Provider } from 'react-redux'; | ||
import { store } from '../store/store'; | ||
import { PersistGate } from 'redux-persist/integration/react'; | ||
import { persistStore } from 'redux-persist'; | ||
import { useAppDispatch } from '../hooks'; | ||
import { resetProfileErrors } from '../store/profile-reducer'; | ||
|
||
const persistor = persistStore(store); | ||
/** | ||
* This component is used to wrap the entire application | ||
*/ | ||
const AppContent: React.FC<ContextProviderProps> = ({ children }) => { | ||
const dispatch = useAppDispatch(); | ||
|
||
useEffect(() => { | ||
// This function will run when the component is first loaded | ||
// Clean errros from previous session | ||
dispatch(resetProfileErrors()); | ||
}, []); | ||
return ( | ||
<PersistGate loading={null} persistor={persistor}> | ||
{children} | ||
</PersistGate> | ||
); | ||
}; | ||
|
||
/** | ||
* This component is used to wrap the entire application adding the store provider and reseting the errors from previous session | ||
*/ | ||
const ContextProviders: React.FC<ContextProviderProps> = ({ children }) => { | ||
return ( | ||
<Provider store={store}> | ||
<AppContent>{children}</AppContent> | ||
</Provider> | ||
); | ||
}; | ||
|
||
export default ContextProviders; |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.