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';
// #860 E2E client/client/src/web-payment/index.js missing fixtures for another client
xdescribe('Client web Payment', () => {
const nightmare = createNightmare();
describe('as employee', () => {
beforeAll(() => {
nightmare
.loginAndModule('employee', 'client')
.accessToSearchResult('Bruce Wayne')
.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('Bruce Wayne')
.accessToSection('client.card.webPayment');
});
it('should be able to confirm payments', async() => {
let exists = await nightmare
.waitToClick(selectors.webPayment.confirmFirstPaymentButton)
.exists(selectors.webPayment.firstPaymentConfirmed);
expect(exists).toBeTruthy();
});
});
});