2018-09-04 09:24:39 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2018-10-24 08:57:14 +00:00
|
|
|
import createNightmare from '../../helpers/nightmare';
|
2018-09-04 09:24:39 +00:00
|
|
|
|
2018-09-12 13:20:39 +00:00
|
|
|
describe('Claim edit basic data path', () => {
|
|
|
|
const nightmare = createNightmare();
|
2018-09-04 09:24:39 +00:00
|
|
|
|
2018-09-12 13:20:39 +00:00
|
|
|
beforeAll(() => {
|
2018-10-25 07:03:43 +00:00
|
|
|
nightmare
|
2018-12-02 23:45:34 +00:00
|
|
|
.loginAndModule('salesAssistant', 'claim')
|
|
|
|
.accessToSearchResult('1')
|
|
|
|
.accessToSection('claim.card.basicData');
|
2018-09-12 13:20:39 +00:00
|
|
|
});
|
2018-09-04 09:24:39 +00:00
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it(`should edit claim state, is paid with mana and observation fields`, async() => {
|
2018-10-30 07:51:18 +00:00
|
|
|
const result = await nightmare
|
2019-01-07 08:33:07 +00:00
|
|
|
.autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Gestionado')
|
2018-10-30 07:51:18 +00:00
|
|
|
.waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox)
|
|
|
|
.clearInput(selectors.claimBasicData.observationInput)
|
2019-01-23 14:33:25 +00:00
|
|
|
.write(selectors.claimBasicData.observationInput, 'edited observation')
|
2019-01-23 15:00:56 +00:00
|
|
|
.waitToClick(selectors.claimBasicData.saveButton)
|
2018-10-30 07:51:18 +00:00
|
|
|
.waitForSnackbar();
|
|
|
|
|
2018-10-25 07:03:43 +00:00
|
|
|
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
|
2018-09-12 13:20:39 +00:00
|
|
|
});
|
2018-09-04 09:24:39 +00:00
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it('should confirm the claim state was edited', async() => {
|
2018-10-30 07:51:18 +00:00
|
|
|
const result = await nightmare
|
2019-01-23 15:00:56 +00:00
|
|
|
.waitToClick(selectors.claimDetail.detailButton)
|
2019-01-22 12:18:20 +00:00
|
|
|
.wait(selectors.claimDetail.addItemButton)
|
2019-01-23 15:00:56 +00:00
|
|
|
.waitToClick(selectors.claimBasicData.basicDataButton)
|
2019-01-07 15:27:55 +00:00
|
|
|
.wait(selectors.claimBasicData.claimStateAutocomplete)
|
2019-01-07 08:33:07 +00:00
|
|
|
.waitToGetProperty(`${selectors.claimBasicData.claimStateAutocomplete} input`, 'value');
|
2018-10-30 07:51:18 +00:00
|
|
|
|
2018-10-25 07:03:43 +00:00
|
|
|
expect(result).toEqual('Gestionado');
|
2018-09-12 13:20:39 +00:00
|
|
|
});
|
2018-09-04 09:24:39 +00:00
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it('should confirm the Is paid with mana checkbox is checked', async() => {
|
2018-10-30 07:51:18 +00:00
|
|
|
const value = await nightmare
|
2018-11-15 11:02:12 +00:00
|
|
|
.evaluate(selector => {
|
2018-10-30 07:51:18 +00:00
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.claimBasicData.isPaidWithManaCheckbox);
|
|
|
|
|
2018-10-25 07:03:43 +00:00
|
|
|
expect(value).toBeTruthy();
|
2018-09-12 13:20:39 +00:00
|
|
|
});
|
2018-09-04 09:24:39 +00:00
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it('should confirm the claim observation was edited', async() => {
|
2018-10-30 07:51:18 +00:00
|
|
|
const result = await nightmare
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.claimBasicData.observationInput, 'value');
|
2018-10-30 07:51:18 +00:00
|
|
|
|
2018-10-25 07:03:43 +00:00
|
|
|
expect(result).toEqual('edited observation');
|
2018-09-12 13:20:39 +00:00
|
|
|
});
|
2018-09-04 09:24:39 +00:00
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it(`should edit the claim to leave it untainted`, async() => {
|
2018-10-30 07:51:18 +00:00
|
|
|
const result = await nightmare
|
2019-01-07 08:33:07 +00:00
|
|
|
.autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Pendiente')
|
2018-10-30 07:51:18 +00:00
|
|
|
.waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox)
|
|
|
|
.clearInput(selectors.claimBasicData.observationInput)
|
2019-01-23 14:33:25 +00:00
|
|
|
.write(selectors.claimBasicData.observationInput, 'Observation one')
|
2019-01-23 15:00:56 +00:00
|
|
|
.waitToClick(selectors.claimBasicData.saveButton)
|
2018-10-30 07:51:18 +00:00
|
|
|
.waitForSnackbar();
|
2018-10-25 07:03:43 +00:00
|
|
|
|
|
|
|
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
|
2018-09-04 09:24:39 +00:00
|
|
|
});
|
|
|
|
});
|