From 9554fc789e914a3b4908191624acadf94db6dc56 Mon Sep 17 00:00:00 2001 From: Miguel Angel Date: Mon, 10 Jun 2024 14:49:32 -0400 Subject: [PATCH 01/63] feat: add d&d sort to calc list --- src/components/computed-properties.vue | 96 ++++++++--------- src/components/sortable/Sortable.vue | 16 ++- .../sortable/sortableList/SortableList.vue | 101 ++++++++++++------ .../sortable/sortableList/sortableList.scss | 56 ++++++---- src/components/vue-form-builder.vue | 25 +++-- 5 files changed, 171 insertions(+), 123 deletions(-) diff --git a/src/components/computed-properties.vue b/src/components/computed-properties.vue index cfea940b3..07082e059 100644 --- a/src/components/computed-properties.vue +++ b/src/components/computed-properties.vue @@ -15,50 +15,27 @@ @hidden="displayTableList" > diff --git a/src/components/sortable/sortableList/sortableList.scss b/src/components/sortable/sortableList/sortableList.scss index 2ed1fe629..14be0d65c 100644 --- a/src/components/sortable/sortableList/sortableList.scss +++ b/src/components/sortable/sortableList/sortableList.scss @@ -77,6 +77,10 @@ $border-color: #cdddee; margin: 9px 0; border-right: 1px solid $border-color; } + + &-disabled > .sortable-item-prop { + color: rgba(85, 98, 113, 0.5); + } } } From 59b653c2fb3b0aae5640d925ee22960d6486ac55 Mon Sep 17 00:00:00 2001 From: Rodrigo Quelca Date: Tue, 11 Jun 2024 11:53:32 -0400 Subject: [PATCH 11/63] add cypress tests --- tests/e2e/specs/ComputedFields.spec.js | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/e2e/specs/ComputedFields.spec.js b/tests/e2e/specs/ComputedFields.spec.js index 3c2813033..264131c80 100644 --- a/tests/e2e/specs/ComputedFields.spec.js +++ b/tests/e2e/specs/ComputedFields.spec.js @@ -30,6 +30,35 @@ describe("Computed fields", () => { }); }); + it("Make sure that calc log was displayed with success result", () => { + cy.visit("/", { + onBeforeLoad(win) { + cy.stub(win.console, "log").as("consoleLog"); + cy.stub(win.console, "error").as("consoleError"); + } + }); + + cy.loadFromJson("FOUR-5139.json", 0); + // Enter preview mode + cy.get("[data-cy=mode-preview]").click(); + + cy.get("@consoleLog").should("be.calledWith", "%c✅ %cCalc \"loop_1\" has %cRUN"); + }); + it("Make sure that calc log was displayed with ERROR result", () => { + cy.visit("/", { + onBeforeLoad(win) { + cy.stub(win.console, "log").as("consoleLog"); + cy.stub(win.console, "groupCollapsed").as("groupCollapsed"); + } + }); + + cy.loadFromJson("FOUR-5139-calcError.json", 0); + // Enter preview mode + cy.get("[data-cy=mode-preview]").click(); + + cy.get("@groupCollapsed").should("be.calledWith", "%c❌ %cCalc \"loop_1\" has %cFAILED"); + }); + it("CRUD of computed fields", () => { cy.visit("/"); From 2420ae6de55fb031bd83fdc61f01f009dd928c19 Mon Sep 17 00:00:00 2001 From: Rodrigo Quelca Date: Tue, 11 Jun 2024 11:53:54 -0400 Subject: [PATCH 12/63] add error calc resource --- tests/e2e/fixtures/FOUR-5139-calcError.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/e2e/fixtures/FOUR-5139-calcError.json diff --git a/tests/e2e/fixtures/FOUR-5139-calcError.json b/tests/e2e/fixtures/FOUR-5139-calcError.json new file mode 100644 index 000000000..8016c6944 --- /dev/null +++ b/tests/e2e/fixtures/FOUR-5139-calcError.json @@ -0,0 +1 @@ +{"type":"screen_package","version":"2","screens":[{"id":13,"screen_category_id":"1","title":"FOUR-5139","description":"Fixture to test ticket FOUR-5139","type":"FORM","config":[{"name":"FOUR-5139","items":[{"items":[{"label":"Line Input","config":{"icon":"far fa-square","name":"form_input_1","type":"text","label":"New Input","helper":null,"dataFormat":"string","validation":null,"placeholder":null},"component":"FormInput","inspector":[{"type":"FormInput","field":"name","config":{"name":"Variable Name","label":"Variable Name","helper":"A variable name is a symbolic name to reference information.","validation":"regex:\/^([a-zA-Z]([a-zA-Z0-9_]?)+\\.?)+(? Date ##\/##\/####
SSN ###-##-####
Phone (###) ###-####","validation":null}},{"type":"FormInput","field":"customCssSelector","config":{"label":"CSS Selector Name","helper":"Use this in your custom css rules","validation":"regex: [-?[_a-zA-Z]+[_-a-zA-Z0-9]*]"}},{"type":"FormInput","field":"ariaLabel","config":{"label":"Aria Label","helper":"Attribute designed to help assistive technology (e.g. screen readers) attach a label"}},{"type":"FormInput","field":"tabindex","config":{"label":"Tab Order","helper":"Order in which a user will move focus from one control to another by pressing the Tab key","validation":"regex: [0-9]*"}}],"editor-control":"FormInput","editor-component":"FormInput"}],"label":"Loop","config":{"icon":"fas fa-redo","name":"loop_1","label":null,"settings":{"add":true,"type":"existing","times":"3","varname":"loop_1"}},"component":"FormLoop","container":true,"inspector":[{"type":"LoopInspector","field":"settings","config":{"label":null,"helper":null}},{"type":"FormInput","field":"conditionalHide","config":{"label":"Visibility Rule","helper":"This control is hidden until this expression is true"}},{"type":"FormInput","field":"customFormatter","config":{"label":"Custom Format String","helper":"Use the Mask Pattern format
Date ##\/##\/####
SSN ###-##-####
Phone (###) ###-####","validation":null}},{"type":"FormInput","field":"customCssSelector","config":{"label":"CSS Selector Name","helper":"Use this in your custom css rules","validation":"regex: [-?[_a-zA-Z]+[_-a-zA-Z0-9]*]"}},{"type":"FormInput","field":"ariaLabel","config":{"label":"Aria Label","helper":"Attribute designed to help assistive technology (e.g. screen readers) attach a label"}},{"type":"FormInput","field":"tabindex","config":{"label":"Tab Order","helper":"Order in which a user will move focus from one control to another by pressing the Tab key","validation":"regex: [0-9]*"}}],"editor-control":"Loop","editor-component":"Loop"}]}],"computed":[{"id":2,"name":"loop_1","type":"javascript","formula":"agents = loop_1;\n\nif (agents === undefined) {\n agents = [];\n}\n\nreturn agents;","property":"loop_1"}],"custom_css":null,"created_at":"2022-02-16T15:27:59+00:00","updated_at":"2022-02-16T15:29:15+00:00","status":"ACTIVE","key":null,"watchers":[],"categories":[{"id":1,"name":"Uncategorized","status":"ACTIVE","is_system":0,"created_at":"2022-02-16T13:46:12+00:00","updated_at":"2022-02-16T13:46:12+00:00","pivot":{"assignable_id":13,"category_id":1,"category_type":"ProcessMaker\\Models\\ScreenCategory"}}]}],"screen_categories":[],"scripts":[]} \ No newline at end of file From e522ae9422419ab673f7d68c0f4468cb2992a122 Mon Sep 17 00:00:00 2001 From: Miguel Angel Date: Tue, 11 Jun 2024 13:23:41 -0400 Subject: [PATCH 13/63] test: add calc drag drop e2e --- src/components/computed-properties.vue | 1 + tests/e2e/fixtures/FOUR-13453.json | 1 + tests/e2e/specs/CalcDragAndDrop.spec.js | 134 ++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 tests/e2e/fixtures/FOUR-13453.json create mode 100644 tests/e2e/specs/CalcDragAndDrop.spec.js diff --git a/src/components/computed-properties.vue b/src/components/computed-properties.vue index dd05bb68b..39e5fa88a 100644 --- a/src/components/computed-properties.vue +++ b/src/components/computed-properties.vue @@ -36,6 +36,7 @@ v-b-tooltip="{ customClass: 'bypass-btn-tooltip' }" :title="item.byPass ? 'Unbypass Calc' : 'Bypass Calc'" class="btn" + data-test="calcs-bypass" @click="toggleBypass(item.id)" > diff --git a/tests/e2e/fixtures/FOUR-13453.json b/tests/e2e/fixtures/FOUR-13453.json new file mode 100644 index 000000000..5e53208ad --- /dev/null +++ b/tests/e2e/fixtures/FOUR-13453.json @@ -0,0 +1 @@ +{"type":"screen_package","version":"2","screens":[{"id":11,"uuid":"9c19be72-bd51-41a3-a8b0-adf7ea50ca7a","screen_category_id":"1","title":"screen01","description":"screen 01","type":"FORM","config":[{"name":"screen01","items":[{"label":"Line Input","config":{"icon":"far fa-square","name":"first_name","type":"text","label":"First Name","helper":null,"readonly":false,"dataFormat":"string","validation":[{"value":"required","helper":"Checks if the length of the String representation of the value is >","content":"Required"}],"placeholder":null,"defaultValue":{"mode":"basic","value":"{{first_name_calc}}"}},"component":"FormInput","inspector":[{"type":"FormInput","field":"name","config":{"name":"Variable Name","label":"Variable Name","helper":"A variable name is a symbolic name to reference information.","validation":"regex:\/^([a-zA-Z]([a-zA-Z0-9_]?)+\\.?)+(? Date ##\/##\/####
SSN ###-##-####
Phone (###) ###-####","validation":null}},{"type":"FormInput","field":"customCssSelector","config":{"label":"CSS Selector Name","helper":"Use this in your custom css rules","validation":"regex: [-?[_a-zA-Z]+[_-a-zA-Z0-9]*]"}},{"type":"FormInput","field":"ariaLabel","config":{"label":"Aria Label","helper":"Attribute designed to help assistive technology (e.g. screen readers) attach a label"}},{"type":"FormInput","field":"tabindex","config":{"label":"Tab Order","helper":"Order in which a user will move focus from one control to another by pressing the Tab key","validation":"regex: [0-9]*"}}],"editor-control":"FormInput","editor-component":"FormInput"},{"label":"Line Input","config":{"icon":"far fa-square","name":"last_name","type":"text","label":"Last Name","helper":null,"readonly":false,"dataFormat":"string","validation":[{"value":"required","helper":"Checks if the length of the String representation of the value is >","content":"Required"}],"placeholder":null,"defaultValue":{"mode":"basic","value":null}},"component":"FormInput","inspector":[{"type":"FormInput","field":"name","config":{"name":"Variable Name","label":"Variable Name","helper":"A variable name is a symbolic name to reference information.","validation":"regex:\/^([a-zA-Z]([a-zA-Z0-9_]?)+\\.?)+(? Date ##\/##\/####
SSN ###-##-####
Phone (###) ###-####","validation":null}},{"type":"FormInput","field":"customCssSelector","config":{"label":"CSS Selector Name","helper":"Use this in your custom css rules","validation":"regex: [-?[_a-zA-Z]+[_-a-zA-Z0-9]*]"}},{"type":"FormInput","field":"ariaLabel","config":{"label":"Aria Label","helper":"Attribute designed to help assistive technology (e.g. screen readers) attach a label"}},{"type":"FormInput","field":"tabindex","config":{"label":"Tab Order","helper":"Order in which a user will move focus from one control to another by pressing the Tab key","validation":"regex: [0-9]*"}}],"editor-control":"FormInput","editor-component":"FormInput"},{"label":"Line Input","config":{"icon":"far fa-square","name":"full_name","type":"text","label":"Full Name","helper":null,"readonly":false,"dataFormat":"string","validation":[{"value":"required","helper":"Checks if the length of the String representation of the value is >","content":"Required"}],"placeholder":null,"defaultValue":{"mode":"basic","value":null}},"component":"FormInput","inspector":[{"type":"FormInput","field":"name","config":{"name":"Variable Name","label":"Variable Name","helper":"A variable name is a symbolic name to reference information.","validation":"regex:\/^([a-zA-Z]([a-zA-Z0-9_]?)+\\.?)+(? Date ##\/##\/####
SSN ###-##-####
Phone (###) ###-####","validation":null}},{"type":"FormInput","field":"customCssSelector","config":{"label":"CSS Selector Name","helper":"Use this in your custom css rules","validation":"regex: [-?[_a-zA-Z]+[_-a-zA-Z0-9]*]"}},{"type":"FormInput","field":"ariaLabel","config":{"label":"Aria Label","helper":"Attribute designed to help assistive technology (e.g. screen readers) attach a label"}},{"type":"FormInput","field":"tabindex","config":{"label":"Tab Order","helper":"Order in which a user will move focus from one control to another by pressing the Tab key","validation":"regex: [0-9]*"}}],"editor-control":"FormInput","editor-component":"FormInput"},{"label":"Line Input","config":{"icon":"far fa-square","name":"email","type":"text","label":"Email","helper":null,"readonly":false,"dataFormat":"string","validation":[{"value":"required","helper":"Checks if the length of the String representation of the value is >","content":"Required"}],"placeholder":null,"defaultValue":{"mode":"basic","value":"{{first_name_calc}}"}},"component":"FormInput","inspector":[{"type":"FormInput","field":"name","config":{"name":"Variable Name","label":"Variable Name","helper":"A variable name is a symbolic name to reference information.","validation":"regex:\/^([a-zA-Z]([a-zA-Z0-9_]?)+\\.?)+(? Date ##\/##\/####
SSN ###-##-####
Phone (###) ###-####","validation":null}},{"type":"FormInput","field":"customCssSelector","config":{"label":"CSS Selector Name","helper":"Use this in your custom css rules","validation":"regex: [-?[_a-zA-Z]+[_-a-zA-Z0-9]*]"}},{"type":"FormInput","field":"ariaLabel","config":{"label":"Aria Label","helper":"Attribute designed to help assistive technology (e.g. screen readers) attach a label"}},{"type":"FormInput","field":"tabindex","config":{"label":"Tab Order","helper":"Order in which a user will move focus from one control to another by pressing the Tab key","validation":"regex: [0-9]*"}}],"editor-control":"FormInput","editor-component":"FormInput"},{"label":"Submit Button","config":{"icon":"fas fa-share-square","name":null,"event":"submit","label":"Save","loading":false,"tooltip":[],"variant":"primary","fieldValue":null,"loadingLabel":"Loading...","defaultSubmit":true},"component":"FormButton","inspector":[{"type":"FormInput","field":"label","config":{"label":"Label","helper":"The label describes the button's text"}},{"type":"FormInput","field":"name","config":{"name":"Variable Name","label":"Variable Name","helper":"A variable name is a symbolic name to reference information.","validation":"regex:\/^(?:[A-Za-z])(?:[0-9A-Z_.a-z])*(? Date ##\/##\/####
SSN ###-##-####
Phone (###) ###-####","validation":null}},{"type":"FormInput","field":"customCssSelector","config":{"label":"CSS Selector Name","helper":"Use this in your custom css rules","validation":"regex: [-?[_a-zA-Z]+[_-a-zA-Z0-9]*]"}},{"type":"FormInput","field":"ariaLabel","config":{"label":"Aria Label","helper":"Attribute designed to help assistive technology (e.g. screen readers) attach a label"}},{"type":"FormInput","field":"tabindex","config":{"label":"Tab Order","helper":"Order in which a user will move focus from one control to another by pressing the Tab key","validation":"regex: [0-9]*"}}],"editor-control":"FormSubmit","editor-component":"FormButton"}],"order":1}],"computed":[{"id":15,"name":"first_name","type":"javascript","order":1,"byPass":false,"formula":"return this.first_name.toLowerCase()","property":"first_name_calc"},{"id":16,"name":"last_name","type":"javascript","order":2,"byPass":false,"formula":"return this.first_name.toUpperCase()","property":"last_name"},{"id":17,"name":"email","type":"javascript","order":3,"byPass":false,"formula":"return this.first_name + \"@email.com\"","property":"email"},{"id":18,"name":"full_name","type":"javascript","order":4,"byPass":false,"formula":"return this.first_name + \" \" + this.last_name","property":"full_name"}],"custom_css":null,"created_at":"2024-05-22T02:10:33+00:00","updated_at":"2024-06-11T16:25:37+00:00","status":"ACTIVE","key":null,"watchers":[],"translations":null,"is_template":0,"asset_type":null,"projects":"[]","categories":[{"id":1,"uuid":"9c19b7a0-e236-43a1-b6c0-6e11753ae5b1","name":"Uncategorized","status":"ACTIVE","is_system":0,"created_at":"2024-05-22T01:51:28+00:00","updated_at":"2024-05-22T01:51:28+00:00","pivot":{"category_type":"ProcessMaker\\Models\\ScreenCategory","assignable_id":11,"category_id":1}}]}],"screen_categories":[],"scripts":[]} diff --git a/tests/e2e/specs/CalcDragAndDrop.spec.js b/tests/e2e/specs/CalcDragAndDrop.spec.js new file mode 100644 index 000000000..35564c990 --- /dev/null +++ b/tests/e2e/specs/CalcDragAndDrop.spec.js @@ -0,0 +1,134 @@ +describe('Calcs list Drag&Drop', () => { + const clickTopBarCalcs = () => { + cy.get('[data-cy="topbar-calcs"]').click(); + }; + + const dragAndDrop = (source, target) => { + const dataTransfer = new DataTransfer(); + + cy.get(source).trigger('dragstart', { dataTransfer }); + cy.get(target) + .trigger('dragenter') + .trigger('dragover', { dataTransfer }) + .trigger('drop', { dataTransfer }); + cy.get(source).trigger('dragend'); + }; + + beforeEach(() => { + cy.visit('/'); + + cy.loadFromJson('FOUR-13453.json', 0); + }); + + it('should drag and drop first row to third row', () => { + clickTopBarCalcs(); + + cy.get('[data-cy="calcs-table"] [data-test="item-1"]').eq(0).as('firstRow'); + cy.get('[data-cy="calcs-table"] [data-test="item-3"]').eq(0).as('thirdRow'); + + cy.get('@firstRow').contains('first_name_calc'); + cy.get('@thirdRow').contains('email'); + + dragAndDrop('@firstRow', '@thirdRow'); + + cy.get('[data-cy="calcs-table"] [data-test="item-1"]').eq(0).contains('last_name'); + cy.get('[data-cy="calcs-table"] [data-test="item-3"]').eq(0).contains('first_name_calc'); + }); + + it('should drag and drop second row to last row', () => { + clickTopBarCalcs(); + + cy.get('[data-cy="calcs-table"] [data-test="item-2"]').eq(0).as('secondRow'); + cy.get('[data-cy="calcs-table"] [data-test="item-4"]').eq(0).as('lastRow'); + + cy.get('@secondRow').contains('last_name'); + cy.get('@lastRow').contains('full_name'); + + dragAndDrop('@secondRow', '@lastRow'); + + cy.get('[data-cy="calcs-table"] [data-test="item-2"]').eq(0).contains('email'); + cy.get('[data-cy="calcs-table"] [data-test="item-4"]').eq(0).contains('last_name'); + }); + + it('should drag and drop last row to first row', () => { + clickTopBarCalcs(); + + cy.get('[data-cy="calcs-table"] [data-test="item-4"]').eq(0).as('lastRow'); + cy.get('[data-cy="calcs-table"] [data-test="item-1"]').eq(0).as('firstRow'); + + cy.get('@lastRow').contains('full_name'); + cy.get('@firstRow').contains('first_name'); + + dragAndDrop('@lastRow', '@firstRow'); + + cy.get('[data-cy="calcs-table"] [data-test="item-4"]').eq(0).contains('email'); + cy.get('[data-cy="calcs-table"] [data-test="item-1"]').eq(0).contains('full_name'); + }); + + it('should drag and drop to sort in ascending mode', () => { + clickTopBarCalcs(); + + cy.get('[data-cy="calcs-table"] [data-test="item-1"]').eq(0).as('firstRow'); + cy.get('[data-cy="calcs-table"] [data-test="item-2"]').eq(0).as('secondRow'); + cy.get('[data-cy="calcs-table"] [data-test="item-3"]').eq(0).as('thirdRow'); + cy.get('[data-cy="calcs-table"] [data-test="item-4"]').eq(0).as('lastRow'); + + cy.get('@firstRow').contains('first_name'); + cy.get('@secondRow').contains('last_name'); + cy.get('@thirdRow').contains('email'); + cy.get('@lastRow').contains('full_name'); + + dragAndDrop('@lastRow', '@secondRow'); + + cy.get('[data-cy="calcs-table"] [data-test="item-4"]').eq(0).contains('email'); + cy.get('[data-cy="calcs-table"] [data-test="item-2"]').eq(0).contains('full_name'); + + cy.get('[data-cy="calcs-table"] [data-test="item-4"]').eq(0).as('lastRow'); + + dragAndDrop('@lastRow', '@firstRow'); + + cy.get('[data-cy="calcs-table"] [data-test="item-4"]').eq(0).contains('last_name'); + cy.get('[data-cy="calcs-table"] [data-test="item-1"]').eq(0).contains('email'); + }); + + it('should edit the name of the first calc', () => { + clickTopBarCalcs(); + + cy.get('[data-cy="calcs-table"] [data-test="item-1"]').eq(0).as('firstRow'); + + cy.get('@firstRow').contains('first_name_calc'); + + cy.get('@firstRow').find('[data-cy="calcs-table-edit"]').click(); + + cy.get('[data-cy="calcs-property-name"]').clear().type("form_input_1"); + cy.get('[data-cy="calcs-button-save"]').click(); + + cy.get('@firstRow').contains('form_input_1'); + }); + + it('should delete the third calc', () => { + clickTopBarCalcs(); + + cy.get('[data-cy="calcs-table"] [data-test="item-3"]').eq(0).as('thirdRow'); + + cy.get('@thirdRow').contains('email'); + + cy.get('@thirdRow').find('[data-cy="calcs-table-remove"]').click(); + + cy.get('[data-cy="calcs-table"] [data-test="item-3"]').should('not.exist'); + }); + + it('should bypass the second calc', () => { + clickTopBarCalcs(); + + cy.get('[data-cy="calcs-table"] [data-test="item-2"]').eq(0).as('secondRow'); + + cy.get('@secondRow').contains('last_name'); + + cy.get('@secondRow').should('not.have.class', 'sortable-item-disabled'); + + cy.get('@secondRow').find('[data-test="calcs-bypass"]').click(); + + cy.get('@secondRow').should('have.class', 'sortable-item-disabled'); + }); +}); From 7ff41d26a8e8854fc3b8e3e093342959caf4e0cb Mon Sep 17 00:00:00 2001 From: Rodrigo Quelca Date: Tue, 11 Jun 2024 16:07:24 -0400 Subject: [PATCH 14/63] add fix for sonarqube duplicated blocks --- tests/e2e/specs/ComputedFields.spec.js | 42 ++++++++++++-------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/tests/e2e/specs/ComputedFields.spec.js b/tests/e2e/specs/ComputedFields.spec.js index 264131c80..d0b4d913f 100644 --- a/tests/e2e/specs/ComputedFields.spec.js +++ b/tests/e2e/specs/ComputedFields.spec.js @@ -1,4 +1,19 @@ describe("Computed fields", () => { + function setupConsoleStubs(stubs) { + cy.visit("/", { + onBeforeLoad(win) { + Object.entries(stubs).forEach(([method, alias]) => { + cy.stub(win.console, method).as(alias); + }); + } + }); + } + + function loadAndPreview(jsonFile) { + cy.loadFromJson(jsonFile, 0); + cy.get("[data-cy=mode-preview]").click(); + } + it("Make sure new rows can be added to the loop, even with a javascript-driven computed field", () => { cy.visit("/"); cy.loadFromJson("FOUR-5139.json", 0); @@ -31,31 +46,14 @@ describe("Computed fields", () => { }); it("Make sure that calc log was displayed with success result", () => { - cy.visit("/", { - onBeforeLoad(win) { - cy.stub(win.console, "log").as("consoleLog"); - cy.stub(win.console, "error").as("consoleError"); - } - }); - - cy.loadFromJson("FOUR-5139.json", 0); - // Enter preview mode - cy.get("[data-cy=mode-preview]").click(); - + setupConsoleStubs({ log: "consoleLog", error: "consoleError" }); + loadAndPreview("FOUR-5139.json"); cy.get("@consoleLog").should("be.calledWith", "%c✅ %cCalc \"loop_1\" has %cRUN"); }); - it("Make sure that calc log was displayed with ERROR result", () => { - cy.visit("/", { - onBeforeLoad(win) { - cy.stub(win.console, "log").as("consoleLog"); - cy.stub(win.console, "groupCollapsed").as("groupCollapsed"); - } - }); - - cy.loadFromJson("FOUR-5139-calcError.json", 0); - // Enter preview mode - cy.get("[data-cy=mode-preview]").click(); + it("Make sure that calc log was displayed with ERROR result", () => { + setupConsoleStubs({ log: "consoleLog", groupCollapsed: "groupCollapsed" }); + loadAndPreview("FOUR-5139-calcError.json"); cy.get("@groupCollapsed").should("be.calledWith", "%c❌ %cCalc \"loop_1\" has %cFAILED"); }); From b36d9b42c7090bc9749a0f8e92e5c1c64b61da05 Mon Sep 17 00:00:00 2001 From: Miguel Angel Date: Wed, 12 Jun 2024 08:56:47 -0400 Subject: [PATCH 15/63] fix(cr): add missing translations, improve sortable list --- src/components/computed-properties.vue | 55 +++++++++++-------- .../sortable/sortableList/SortableList.vue | 2 +- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/components/computed-properties.vue b/src/components/computed-properties.vue index 39e5fa88a..a8e020150 100644 --- a/src/components/computed-properties.vue +++ b/src/components/computed-properties.vue @@ -34,7 +34,7 @@