Skip to content

Commit

Permalink
Merge pull request #1426 from ProcessMaker/bugfix/FOUR-8770
Browse files Browse the repository at this point in the history
FOUR-8770: Watcher script configuration strips line breaks
  • Loading branch information
ryancooley authored Aug 4, 2023
2 parents 26c3507 + 1ab722d commit 4fc6386
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/watchers-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ export default {
try {
const currentConf = JSON.parse(this.config.script_configuration);
const newConf = JSON.parse(value);
this.config.script_configuration = JSON.stringify({...currentConf, ...newConf});
this.config.script_configuration = JSON.stringify({...currentConf, ...newConf}, null, '\t');
} catch {
// Invalid json will get caught by the validator
}
Expand Down
8 changes: 6 additions & 2 deletions tests/e2e/specs/ComputedFieldsReadOnly.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {waitUntilElementIsVisible} from '../support/utils';

describe('Computed fields', () => {

it('The user should not be able to change a FormInput assigned to a computed property', () => {
Expand Down Expand Up @@ -135,7 +137,7 @@ describe('Computed fields', () => {
});
});

it('The user should not be able to change a FormDatePicker assigned to a computed property', () => {
it.only('The user should not be able to change a FormDatePicker assigned to a computed property', () => {
cy.visit('/');
// Add an input field
cy.get('[data-cy=controls-FormDatePicker]').drag('[data-cy=screen-drop-zone]', 'bottom');
Expand All @@ -153,11 +155,13 @@ describe('Computed fields', () => {
cy.get('[data-cy=mode-preview]').click();

// Assertion: Check the form_date_picker_1 is read only
cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] input').should('have.attr', 'readonly');
cy.get('[data-cy=preview-content] [data-cy="screen-field-form_date_picker_1"] input').should('have.attr', 'disabled');

// Assertion: Check the form_date_picker_1 is always 1
cy.assertPreviewData({
form_date_picker_1: '1',
});

});

it('The user should not be able to change a FormSelectList assigned to a computed property', () => {
Expand Down

0 comments on commit 4fc6386

Please sign in to comment.