-
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.
Merge pull request #213 from n8io/test/add-e2e-test-for-password-rese…
…t-210
- Loading branch information
Showing
15 changed files
with
66 additions
and
45 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const users = { | ||
valid: { | ||
password: 'password', | ||
username: 'user', | ||
}, | ||
}; | ||
|
||
export { users }; |
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,27 @@ | ||
import { users } from '../fixtures/users'; | ||
|
||
describe('routes', () => { | ||
beforeEach(() => { | ||
cy.visit('/login'); | ||
}); | ||
|
||
it('resolves to the login route', () => { | ||
cy.location('pathname').should('eq', '/login'); | ||
}); | ||
|
||
// eslint-disable-next-line jest/no-disabled-tests | ||
it.skip('handles a valid login', () => { | ||
const { password, username } = users.valid; | ||
|
||
cy.login(username, password); | ||
cy.location('pathname').should('eq', '/'); | ||
}); | ||
|
||
it('handles an invalid login', () => { | ||
const password = 'INVALID'; | ||
const { username } = users.valid; | ||
|
||
cy.login(username, password); | ||
cy.get('div[data-testid="notification"]').should('be.visible'); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* eslint-disable no-console */ | ||
Cypress.on('uncaught:exception', (err, runnable) => { | ||
console.log(`err :${err}`); | ||
console.log(`runnable :${runnable}`); | ||
|
||
return false; | ||
}); | ||
/* eslint-enable no-console */ |
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,8 +1,8 @@ | ||
import React from 'react'; | ||
|
||
const Menu = (props) => <x-Menu {...props} />; | ||
const MenuDisclosure = (props) => <x-MenuDisclosure {...props} />; | ||
const MenuButton = (props) => <x-MenuButton {...props} />; | ||
const MenuItem = (props) => <x-MenuItem {...props} />; | ||
const useMenuState = () => ({ hide: jest.fn().mockName('hide') }); | ||
|
||
export { Menu, MenuDisclosure, MenuItem, useMenuState }; | ||
export { Menu, MenuButton, MenuItem, useMenuState }; |
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,23 +1,10 @@ | ||
import { config } from 'config'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { App } from 'modules/app'; | ||
import { initializeTranslations } from './i18n'; | ||
|
||
const { isProduction } = config; | ||
|
||
initializeTranslations(); | ||
|
||
const rootEl = document.getElementById('root'); | ||
|
||
if (isProduction) { | ||
ReactDOM.render(<App />, rootEl); | ||
} else { | ||
import( | ||
/* webpackChunkName: "devTools" */ | ||
'devTools' | ||
).then(async ({ load }) => { | ||
await load(); | ||
ReactDOM.render(<App />, rootEl); | ||
}); | ||
} | ||
ReactDOM.render(<App />, rootEl); |
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
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