salix/e2e/paths/client-module/16_web_payment.spec.js

41 lines
1.3 KiB
JavaScript
Raw Normal View History

import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
describe('Client web Payment', () => {
const nightmare = createNightmare();
describe('as employee', () => {
beforeAll(() => {
nightmare
.loginAndModule('employee', 'client')
.accessToSearchResult('Tony Stark')
.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')
.accessToSearchResult('Tony Stark')
.accessToSection('client.card.webPayment');
});
it('should be able to confirm payments', async() => {
let exists = await nightmare
.waitToClick(selectors.webPayment.confirmFirstPaymentButton)
.wait(selectors.webPayment.firstPaymentConfirmed)
.exists(selectors.webPayment.firstPaymentConfirmed);
expect(exists).toBeTruthy();
});
});
});