2019-02-20 11:49:39 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import createNightmare from '../../helpers/nightmare';
|
|
|
|
|
2019-03-01 10:30:59 +00:00
|
|
|
describe('Client web Payment', () => {
|
2019-02-20 11:49:39 +00:00
|
|
|
const nightmare = createNightmare();
|
|
|
|
|
|
|
|
describe('as employee', () => {
|
|
|
|
beforeAll(() => {
|
|
|
|
nightmare
|
|
|
|
.loginAndModule('employee', 'client')
|
2019-03-01 10:30:59 +00:00
|
|
|
.accessToSearchResult('Tony Stark')
|
2019-02-20 11:49:39 +00:00
|
|
|
.accessToSection('client.card.webPayment');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not be able to confirm payments', async() => {
|
|
|
|
let exists = await nightmare
|
|
|
|
.exists(selectors.webPayment.confirmFirstPaymentButton);
|
|
|
|
|
|
|
|
expect(exists).toBeFalsy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('as administrative', () => {
|
|
|
|
beforeAll(() => {
|
|
|
|
nightmare
|
|
|
|
.loginAndModule('administrative', 'client')
|
2019-03-01 10:30:59 +00:00
|
|
|
.accessToSearchResult('Tony Stark')
|
2019-02-20 11:49:39 +00:00
|
|
|
.accessToSection('client.card.webPayment');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should be able to confirm payments', async() => {
|
|
|
|
let exists = await nightmare
|
|
|
|
.waitToClick(selectors.webPayment.confirmFirstPaymentButton)
|
2019-03-01 10:30:59 +00:00
|
|
|
.wait(selectors.webPayment.firstPaymentConfirmed)
|
2019-02-20 11:49:39 +00:00
|
|
|
.exists(selectors.webPayment.firstPaymentConfirmed);
|
|
|
|
|
|
|
|
expect(exists).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|