From 9a4b48df7b4ae717ff7cfe6e9b524bc08af9c825 Mon Sep 17 00:00:00 2001 From: Carita Date: Tue, 16 Jul 2024 14:41:12 -0700 Subject: [PATCH] #2057 Downgrade Carbon (#2059) Signed-off-by: Carita Ou --- canvas_modules/common-canvas/package.json | 2 +- .../cypress/support/canvas/test-harness-cmds.js | 6 ++++-- .../support/properties/expression-editor-cmds.js | 10 +++++++++- canvas_modules/harness/package.json | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/canvas_modules/common-canvas/package.json b/canvas_modules/common-canvas/package.json index b82de7e153..bd082abd83 100644 --- a/canvas_modules/common-canvas/package.json +++ b/canvas_modules/common-canvas/package.json @@ -59,7 +59,7 @@ "@babel/plugin-transform-runtime": "7.11.5", "@babel/preset-env": "7.11.5", "@babel/preset-react": "7.10.4", - "@carbon/react": "^1.52.0", + "@carbon/react": "1.62.0-rc.0", "@rollup/plugin-babel": "5.3.0", "@rollup/plugin-commonjs": "21.0.1", "@rollup/plugin-json": "4.1.0", diff --git a/canvas_modules/harness/cypress/support/canvas/test-harness-cmds.js b/canvas_modules/harness/cypress/support/canvas/test-harness-cmds.js index c934fa7ade..eabd3577c9 100644 --- a/canvas_modules/harness/cypress/support/canvas/test-harness-cmds.js +++ b/canvas_modules/harness/cypress/support/canvas/test-harness-cmds.js @@ -88,8 +88,10 @@ Cypress.Commands.add("dropdownSelect", (dropdownElement, selectedItemName) => { // Select option from drop down list cy.get(".cds--list-box__menu") .find(".cds--list-box__menu-item") - .then((options) => options.filter((idx) => options[idx].outerText === selectedItemName)) - .click(); + .then((options) => { + const opt = options.filter((idx) => options[idx].outerText === selectedItemName); + opt.click(); + }); }); Cypress.Commands.add("setCanvasConfig", (config) => { diff --git a/canvas_modules/harness/cypress/support/properties/expression-editor-cmds.js b/canvas_modules/harness/cypress/support/properties/expression-editor-cmds.js index 71d1b7ab92..3bc41a4a65 100644 --- a/canvas_modules/harness/cypress/support/properties/expression-editor-cmds.js +++ b/canvas_modules/harness/cypress/support/properties/expression-editor-cmds.js @@ -15,6 +15,12 @@ */ Cypress.Commands.add("enterTextInExpressionEditor", (text, propertyId) => { + const clipboardData = new DataTransfer(); + clipboardData.setData("text/plain", text); + const pasteEvent = new ClipboardEvent("paste", { + clipboardData + }); + cy.useCtrlOrCmdKey() .then((selectedKey) => { cy.get(`div[data-id='properties-ctrl-${propertyId}']`) @@ -24,8 +30,10 @@ Cypress.Commands.add("enterTextInExpressionEditor", (text, propertyId) => { .as("editorContent"); cy.get("@editorContent") .type(selectedKey + "{a}{del}"); // Select all and delete existing text in expression editor + cy.get(".cm-editor [role='textbox']") // Paste text in place of typing https://stackoverflow.com/questions/55362875/how-to-type-using-cypress-type-inside-the-codemirror-editor + .trigger("paste", pasteEvent); cy.get("@editorContent") - .type(text + "{ctrl} "); // Type text and ctrl + space to display hints + .type("{ctrl} "); // Type ctrl + space to display hints }); }); diff --git a/canvas_modules/harness/package.json b/canvas_modules/harness/package.json index 99e087eed3..4666a3cbeb 100644 --- a/canvas_modules/harness/package.json +++ b/canvas_modules/harness/package.json @@ -36,7 +36,7 @@ "@babel/preset-react": "7.24.1", "@carbon/charts": "1.15.3", "@carbon/charts-react": "1.15.3", - "@carbon/react": "^1.52.0", + "@carbon/react": "1.62.0-rc.0", "@elyra/canvas": "file:../common-canvas", "@pmmmwh/react-refresh-webpack-plugin": "0.5.11", "ajv": "8.12.0",