2018-03-09 19:04:03 +00:00
|
|
|
import selectors from '../helpers/selectors';
|
2018-10-24 08:57:14 +00:00
|
|
|
import createNightmare from '../helpers/nightmare';
|
2018-03-09 19:04:03 +00:00
|
|
|
|
|
|
|
describe('create client path', () => {
|
|
|
|
let nightmare = createNightmare();
|
|
|
|
|
|
|
|
beforeAll(() => {
|
|
|
|
return nightmare
|
2018-10-11 07:14:26 +00:00
|
|
|
.waitForLogin('employee');
|
2018-03-09 19:04:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should access to the clients index by clicking the clients button', () => {
|
|
|
|
return nightmare
|
|
|
|
.click(selectors.moduleAccessView.clientsSectionButton)
|
|
|
|
.wait(selectors.clientsIndex.createClientButton)
|
|
|
|
.parsedUrl()
|
|
|
|
.then(url => {
|
2018-05-23 12:26:51 +00:00
|
|
|
expect(url.hash).toEqual('#!/client/index');
|
2018-03-09 19:04:03 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should access to the create client view by clicking the create-client floating button', () => {
|
|
|
|
return nightmare
|
|
|
|
.click(selectors.clientsIndex.createClientButton)
|
|
|
|
.wait(selectors.createClientView.createButton)
|
|
|
|
.parsedUrl()
|
|
|
|
.then(url => {
|
2018-05-23 12:26:51 +00:00
|
|
|
expect(url.hash).toEqual('#!/client/create');
|
2018-03-09 19:04:03 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should cancel the client creation to go back to clients index', () => {
|
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
|
|
.waitToClick(selectors.globalItems.clientsButton)
|
|
|
|
.wait(selectors.clientsIndex.createClientButton)
|
|
|
|
.parsedUrl()
|
|
|
|
.then(url => {
|
2018-05-23 12:26:51 +00:00
|
|
|
expect(url.hash).toEqual('#!/client/index');
|
2018-03-09 19:04:03 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|