UI/InfoTableRow testing (#12811)

* updates storybook

* adds computed property valueIsEmpty

* adds tests to info table row
This commit is contained in:
claire bontempo
2021-10-13 10:52:23 -07:00
committed by GitHub
parent 56c6f3c9d0
commit 1f1459eba2
5 changed files with 82 additions and 18 deletions

View File

@@ -44,4 +44,21 @@ export default Component.extend({
valueIsBoolean: computed('value', function() {
return typeOf(this.value) === 'boolean';
}),
valueIsEmpty: computed('value', function() {
let { value } = this;
if (typeOf(value) === 'array' && value.length === 0) {
return true;
}
switch (value) {
case undefined:
return true;
case null:
return true;
case '':
return true;
default:
return false;
}
}),
});