31 lines
1.0 KiB
JavaScript
31 lines
1.0 KiB
JavaScript
import selectors from '../helpers/selectors';
|
|
import createNightmare from '../helpers/nightmare';
|
|
|
|
describe('create client path', () => {
|
|
let nightmare = createNightmare();
|
|
|
|
beforeAll(() => {
|
|
return nightmare
|
|
.loginAndModule('employee', 'client');
|
|
});
|
|
|
|
it('should access to the create client view by clicking the create-client floating button', async () => {
|
|
let url = await nightmare
|
|
.click(selectors.clientsIndex.createClientButton)
|
|
.wait(selectors.createClientView.createButton)
|
|
.parsedUrl();
|
|
|
|
expect(url.hash).toEqual('#!/client/create');
|
|
});
|
|
|
|
it('should cancel the client creation to go back to clients index', async () => {
|
|
let url = await nightmare
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
.waitToClick(selectors.globalItems.clientsButton)
|
|
.wait(selectors.clientsIndex.createClientButton)
|
|
.parsedUrl();
|
|
|
|
expect(url.hash).toEqual('#!/client/index');
|
|
});
|
|
});
|