Skip to content

Commit 9bdd2c5

Browse files
gustavokathilhan007
authored andcommitted
fix(ui5-checkbox): correct default values of the boolean props (#408)
1 parent 9c243f9 commit 9bdd2c5

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

packages/main/src/CheckBox.js

+10
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ const metadata = {
2626
* <b>Note:</b> A disabled <code>ui5-checkbox</code> is completely uninteractive.
2727
*
2828
* @type {boolean}
29+
* @defaultvalue false
2930
* @public
3031
*/
3132
disabled: {
3233
type: Boolean,
34+
defaultValue: false,
3335
},
3436

3537
/**
@@ -39,10 +41,12 @@ const metadata = {
3941
* but still provides visual feedback upon user interaction.
4042
*
4143
* @type {boolean}
44+
* @defaultvalue false
4245
* @public
4346
*/
4447
readOnly: {
4548
type: Boolean,
49+
defaultValue: false,
4650
},
4751

4852
/**
@@ -53,16 +57,19 @@ const metadata = {
5357
* pressing the Enter or Space key.
5458
*
5559
* @type {boolean}
60+
* @defaultvalue false
5661
* @public
5762
*/
5863
checked: {
5964
type: Boolean,
65+
defaultValue: false,
6066
},
6167

6268
/**
6369
* Defines the text of the <code>ui5-checkbox</code>.
6470
*
6571
* @type {string}
72+
* @defaultvalue ""
6673
* @public
6774
*/
6875
text: {
@@ -76,6 +83,7 @@ const metadata = {
7683
* <b>Note:</b> Available options are <code>Warning</code>, <code>Error</code>, and <code>None</code> (default).
7784
*
7885
* @type {string}
86+
* @defaultvalue None
7987
* @public
8088
*/
8189
valueState: {
@@ -89,10 +97,12 @@ const metadata = {
8997
* <b>Note:</b> By default, the text truncates when there is not enough space.
9098
*
9199
* @type {boolean}
100+
* @defaultvalue false
92101
* @public
93102
*/
94103
wrap: {
95104
type: Boolean,
105+
defaultValue: false,
96106
},
97107

98108
/**

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ const assert = require('assert');
33
describe("CheckBox general interaction", () => {
44
browser.url("http://localhost:8080/test-resources/sap/ui/webcomponents/main/pages/CheckBox.html");
55

6+
it("tests checked default value is false", () => {
7+
const checkBox = browser.findElementDeep("#cb1");
8+
9+
assert.strictEqual(checkBox.getProperty("checked"), false, "Check if default value for checked is false");
10+
});
11+
612
it("tests change event", () => {
713
const checkBox = browser.findElementDeep("#cb1");
814
const field = browser.findElementDeep("#field");
@@ -36,4 +42,4 @@ describe("CheckBox general interaction", () => {
3642
assert.strictEqual(truncatingCbHeight, CHECKBOX_DEFAULT_HEIGHT, "The size of the checkbox is : " + truncatingCbHeight);
3743
assert.ok(wrappingCbHeight > CHECKBOX_DEFAULT_HEIGHT, "The size of the checkbox is more than: " + CHECKBOX_DEFAULT_HEIGHT);
3844
});
39-
});
45+
});

0 commit comments

Comments
 (0)