Skip to content

Commit

Permalink
[Advanced settings] Reset to default for empty strings (#85137)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
stratoula and kibanamachine authored Dec 10, 2020
1 parent 0f40804 commit b46655d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ describe('Settings', function () {
});

describe('without a value', function () {
it('should return true', function () {
it('should return false for empty string but true for undefined', function () {
expect(isDefaultValue({ ...setting, value: undefined })).to.be(true);
expect(isDefaultValue({ ...setting, value: '' })).to.be(true);
expect(isDefaultValue({ ...setting, value: '' })).to.be(false);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export function isDefaultValue(setting: FieldSetting) {
return (
setting.isCustom ||
setting.value === undefined ||
setting.value === '' ||
String(setting.value) === String(setting.defVal)
);
}

0 comments on commit b46655d

Please sign in to comment.