Skip to content

Commit 23ce10f

Browse files
authored
fix(ui5-radio-button): exploratory testing issues (#3740)
1 parent bd0b33a commit 23ce10f

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

packages/main/src/themes/RadioButton.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
text-overflow: ellipsis;
1111
overflow: hidden;
1212
color: var(--sapField_BorderColor);
13+
cursor: pointer;
1314
}
1415

1516
/* Checked */
@@ -98,7 +99,7 @@
9899
.ui5-radio-root {
99100
height: var(--_ui5_radio_button_height);
100101
position: relative;
101-
display: flex;
102+
display: inline-flex;
102103
flex-wrap: nowrap;
103104
outline: none;
104105
max-width: 100%;

packages/main/test/samples/RadioButton.sample.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ <h3>Basic RadioButton Types</h3>
1414
<ui5-radio-button text="Option C" value-state="Warning" name="GroupA"></ui5-radio-button>
1515
<ui5-radio-button text="Option D" value-state="Error" name="GroupA"></ui5-radio-button>
1616
<ui5-radio-button text="Option E" disabled name="GroupA"></ui5-radio-button>
17+
<ui5-radio-button text="Option F" readonly name="GroupA"></ui5-radio-button>
1718
</div>
1819
<pre class="prettyprint lang-html"><xmp>
1920
<ui5-radio-button text="Option A" checked name="GroupA"></ui5-radio-button>
2021
<ui5-radio-button text="Option B" value-state="None" name="GroupA"></ui5-radio-button>
2122
<ui5-radio-button text="Option C" value-state="Warning" name="GroupA"></ui5-radio-button>
2223
<ui5-radio-button text="Option D" value-state="Error" name="GroupA"></ui5-radio-button>
2324
<ui5-radio-button text="Option E" disabled name="GroupA"></ui5-radio-button>
25+
<ui5-radio-button text="Option F" readonly name="GroupA"></ui5-radio-button>
2426
</xmp></pre>
2527
</section>
2628

packages/main/test/specs/RadioButton.spec.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe("RadioButton general interaction", () => {
77
});
88

99
it("tests change event", () => {
10-
const radioButton = browser.$("#rb1");
10+
const radioButton = browser.$("#rb1").shadow$(".ui5-radio-root");
1111
const field = browser.$("#field");
1212

1313
radioButton.click();
@@ -18,8 +18,8 @@ describe("RadioButton general interaction", () => {
1818
});
1919

2020
it("tests change event upon ENTER", () => {
21-
const radioButton1 = browser.$("#rb1");
22-
const radioButton2 = browser.$("#rb2");
21+
const radioButton1 = browser.$("#rb1").shadow$(".ui5-radio-root");
22+
const radioButton2 = browser.$("#rb2").shadow$(".ui5-radio-root");;
2323
const field = browser.$("#field");
2424

2525
radioButton1.click();
@@ -33,8 +33,8 @@ describe("RadioButton general interaction", () => {
3333
});
3434

3535
it("tests change event upon SPACE", () => {
36-
const radioButton1 = browser.$("#rb2");
37-
const radioButton2 = browser.$("#rb3");
36+
const radioButton1 = browser.$("#rb2").shadow$(".ui5-radio-root");;
37+
const radioButton2 = browser.$("#rb3").shadow$(".ui5-radio-root");;
3838
const field = browser.$("#field");
3939

4040
radioButton1.click();
@@ -48,7 +48,7 @@ describe("RadioButton general interaction", () => {
4848
});
4949

5050
it("tests change event not fired, when disabled", () => {
51-
const radioButton = browser.$("#rb4");
51+
const radioButton = browser.$("#rb4").shadow$(".ui5-radio-root");;
5252
const field = browser.$("#field");
5353

5454
radioButton.click();
@@ -132,11 +132,12 @@ describe("RadioButton general interaction", () => {
132132
});
133133

134134
it("tests change event from radio buttons within group", () => {
135+
const radioButtonToBeSelectedShadow = browser.$("#groupRb7").shadow$(".ui5-radio-root");
135136
const radioButtonToBeSelected = browser.$("#groupRb7");
136137
const lblEventCounter = browser.$("#lblEventCounter");
137138
const lblSelectedRadio = browser.$("#lblRadioGroup");
138139

139-
radioButtonToBeSelected.click();
140+
radioButtonToBeSelectedShadow.click();
140141

141142
assert.equal(lblEventCounter.getHTML(false), "1", 'The change event is fired once');
142143
assert.equal(lblSelectedRadio.getHTML(false), radioButtonToBeSelected.getProperty("text"), "The correct radio is selected");

0 commit comments

Comments
 (0)