From 3f1ed69a236e6fc2c87f51f87f7f2247d3c20a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=CC=88nther=20Debrauwer?= Date: Fri, 19 Jul 2024 14:25:30 +0200 Subject: [PATCH 1/3] Add failing tests --- .../integration/plugins/ui/radio.spec.js | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/cypress/integration/plugins/ui/radio.spec.js b/tests/cypress/integration/plugins/ui/radio.spec.js index 7106ee610..138eeb1e0 100644 --- a/tests/cypress/integration/plugins/ui/radio.spec.js +++ b/tests/cypress/integration/plugins/ui/radio.spec.js @@ -253,6 +253,49 @@ test('keyboard navigation works', }, ) +test('keyboard navigation works when first option has null as value', + [html` +
+
+
+
+
+
+ + +
+ `], + ({ get }) => { + get('[option="option-1"]').focus().type('{downarrow}') + get('[option="option-2"]').should(haveFocus()).type('{uparrow}') + get('[option="option-1"]').should(haveFocus()).type('{uparrow}') + get('[option="option-null"]').should(haveFocus()).type('{uparrow}') + get('[option="option-2"]').should(haveFocus()).type('{downarrow}') + get('[option="option-null"]').should(haveFocus()) + }, +) + +test('keyboard navigation works when last option has null as value', + [html` +
+
+
+
+
+
+ + +
+ `], + ({ get }) => { + get('[option="option-1"]').focus().type('{downarrow}') + get('[option="option-2"]').should(haveFocus()).type('{downarrow}') + get('[option="option-null"]').should(haveFocus()).type('{downarrow}') + get('[option="option-1"]').should(haveFocus()).type('{uparrow}') + get('[option="option-null"]').should(haveFocus()) + }, +) + test('has accessibility attributes', [html`