Skip to content

Commit

Permalink
fix(ui5-checkbox): correct default values of the boolean props (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavokath authored and ilhan007 committed May 20, 2019
1 parent 9c243f9 commit 9bdd2c5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 10 additions & 0 deletions packages/main/src/CheckBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ const metadata = {
* <b>Note:</b> A disabled <code>ui5-checkbox</code> is completely uninteractive.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
disabled: {
type: Boolean,
defaultValue: false,
},

/**
Expand All @@ -39,10 +41,12 @@ const metadata = {
* but still provides visual feedback upon user interaction.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
readOnly: {
type: Boolean,
defaultValue: false,
},

/**
Expand All @@ -53,16 +57,19 @@ const metadata = {
* pressing the Enter or Space key.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
checked: {
type: Boolean,
defaultValue: false,
},

/**
* Defines the text of the <code>ui5-checkbox</code>.
*
* @type {string}
* @defaultvalue ""
* @public
*/
text: {
Expand All @@ -76,6 +83,7 @@ const metadata = {
* <b>Note:</b> Available options are <code>Warning</code>, <code>Error</code>, and <code>None</code> (default).
*
* @type {string}
* @defaultvalue None
* @public
*/
valueState: {
Expand All @@ -89,10 +97,12 @@ const metadata = {
* <b>Note:</b> By default, the text truncates when there is not enough space.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
wrap: {
type: Boolean,
defaultValue: false,
},

/**
Expand Down
8 changes: 7 additions & 1 deletion packages/main/test/specs/CheckBox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ const assert = require('assert');
describe("CheckBox general interaction", () => {
browser.url("http://localhost:8080/test-resources/sap/ui/webcomponents/main/pages/CheckBox.html");

it("tests checked default value is false", () => {
const checkBox = browser.findElementDeep("#cb1");

assert.strictEqual(checkBox.getProperty("checked"), false, "Check if default value for checked is false");
});

it("tests change event", () => {
const checkBox = browser.findElementDeep("#cb1");
const field = browser.findElementDeep("#field");
Expand Down Expand Up @@ -36,4 +42,4 @@ describe("CheckBox general interaction", () => {
assert.strictEqual(truncatingCbHeight, CHECKBOX_DEFAULT_HEIGHT, "The size of the checkbox is : " + truncatingCbHeight);
assert.ok(wrappingCbHeight > CHECKBOX_DEFAULT_HEIGHT, "The size of the checkbox is more than: " + CHECKBOX_DEFAULT_HEIGHT);
});
});
});

0 comments on commit 9bdd2c5

Please sign in to comment.