Skip to content

Commit

Permalink
fix(ui5-radio-button): exploratory testing issues (#3740)
Browse files Browse the repository at this point in the history
  • Loading branch information
kskondov authored Sep 3, 2021
1 parent bd0b33a commit 23ce10f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion packages/main/src/themes/RadioButton.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
text-overflow: ellipsis;
overflow: hidden;
color: var(--sapField_BorderColor);
cursor: pointer;
}

/* Checked */
Expand Down Expand Up @@ -98,7 +99,7 @@
.ui5-radio-root {
height: var(--_ui5_radio_button_height);
position: relative;
display: flex;
display: inline-flex;
flex-wrap: nowrap;
outline: none;
max-width: 100%;
Expand Down
2 changes: 2 additions & 0 deletions packages/main/test/samples/RadioButton.sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ <h3>Basic RadioButton Types</h3>
<ui5-radio-button text="Option C" value-state="Warning" name="GroupA"></ui5-radio-button>
<ui5-radio-button text="Option D" value-state="Error" name="GroupA"></ui5-radio-button>
<ui5-radio-button text="Option E" disabled name="GroupA"></ui5-radio-button>
<ui5-radio-button text="Option F" readonly name="GroupA"></ui5-radio-button>
</div>
<pre class="prettyprint lang-html"><xmp>
<ui5-radio-button text="Option A" checked name="GroupA"></ui5-radio-button>
<ui5-radio-button text="Option B" value-state="None" name="GroupA"></ui5-radio-button>
<ui5-radio-button text="Option C" value-state="Warning" name="GroupA"></ui5-radio-button>
<ui5-radio-button text="Option D" value-state="Error" name="GroupA"></ui5-radio-button>
<ui5-radio-button text="Option E" disabled name="GroupA"></ui5-radio-button>
<ui5-radio-button text="Option F" readonly name="GroupA"></ui5-radio-button>
</xmp></pre>
</section>

Expand Down
15 changes: 8 additions & 7 deletions packages/main/test/specs/RadioButton.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("RadioButton general interaction", () => {
});

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

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

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

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

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

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

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

radioButton.click();
Expand Down Expand Up @@ -132,11 +132,12 @@ describe("RadioButton general interaction", () => {
});

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

radioButtonToBeSelected.click();
radioButtonToBeSelectedShadow.click();

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

0 comments on commit 23ce10f

Please sign in to comment.