import selectors from '../../helpers/selectors.js'; import createNightmare from '../../helpers/nightmare'; describe('Worker pbx path', () => { const nightmare = createNightmare(); beforeAll(() => { nightmare .loginAndModule('hr', 'worker') .accessToSearchResult('employee') .accessToSection('worker.card.pbx'); }); it('should receive an error when the extension exceeds 4 characters', async() => { const result = await nightmare .write(selectors.workerPbx.extensionInput, 55555) .waitToClick(selectors.workerPbx.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Extension format is invalid'); }); it('should sucessfully save the changes', async() => { const result = await nightmare .clearInput(selectors.workerPbx.extensionInput) .write(selectors.workerPbx.extensionInput, 4444) .waitToClick(selectors.workerPbx.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved! User must access web'); }); });