jomarko commented on code in PR #3440:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3440#discussion_r2818033333


##########
packages/boxed-expression-component/tests-e2e/features/keyboard/keyboard.spec.ts:
##########
@@ -17,25 +17,120 @@
  * under the License.
  */
 
-import { test } from "../../__fixtures__/base";
+import { expect, test } from "../../__fixtures__/base";
+
+const ACTIVE_CLASS_REGEXP = /(^|\s)active(\s|$)/;
 
 test.describe("Keyboard", () => {
-  test.skip(true, "https://github.com/apache/incubator-kie-issues/issues/542";);
   test.describe("Navigation", () => {
-    test("should correctly navigate", async () => {
-      // enter, shift+enter, tab, shift+tab, escape
-    });
+    test("should correctly navigate", async ({ bee, page, useCases }) => {
+      await useCases.openLoanOriginations("bureau-strategy-decision-service", 
"bureau-call-type");
+      const decisionTable = bee.expression.asDecisionTable();
+      await decisionTable.cellAt({ row: 1, column: 1 }).select();
+
+      await page.keyboard.press("ArrowRight");
+      await expect(decisionTable.cellAt({ row: 1, column: 2 
}).content).toHaveClass(ACTIVE_CLASS_REGEXP);
+
+      await page.keyboard.press("ArrowDown");
+      await expect(decisionTable.cellAt({ row: 2, column: 2 
}).content).toHaveClass(ACTIVE_CLASS_REGEXP);
+
+      await page.keyboard.press("ArrowUp");
+      await expect(decisionTable.cellAt({ row: 1, column: 2 
}).content).toHaveClass(ACTIVE_CLASS_REGEXP);
+
+      await page.keyboard.press("ArrowLeft");
+      await expect(decisionTable.cellAt({ row: 1, column: 1 
}).content).toHaveClass(ACTIVE_CLASS_REGEXP);
+
+      await page.keyboard.type(`"test"`);
+      await expect(decisionTable.cellAt({ row: 1, column: 1 
}).content).toHaveClass(ACTIVE_CLASS_REGEXP);
+
+      await page.keyboard.press("Enter");
+      await expect(decisionTable.cellAt({ row: 1, column: 1 
}).content).toContainText(`"test"`);
+      await expect(decisionTable.cellAt({ row: 2, column: 1 
}).content).toHaveClass(ACTIVE_CLASS_REGEXP);
 
-    test.describe("Arrow keys", () => {
-      test("should correctly navigate", async () => {
-        // arrow up/down/left/right
-      });
+      await page.keyboard.type(`"test2"`);
+      await expect(decisionTable.cellAt({ row: 2, column: 1 
}).content).toHaveClass(ACTIVE_CLASS_REGEXP);
+
+      await page.keyboard.press("Escape");
+      await expect(decisionTable.cellAt({ row: 1, column: 1 
}).content).not.toContainText(`"test2"`);

Review Comment:
   I think here should be row: 2 instead of row: 1



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to