FIX: reverts combobox placeholder and introduces noneLabel

noneLabels works almost like none but instead of actually adding a row in the list, it will only change the text displayed in the header, when there's no selection.
This commit is contained in:
Joffrey JAFFEUX
2018-03-29 13:42:00 +02:00
committed by GitHub
parent 125434dcdf
commit 3287ac77e0
10 changed files with 41 additions and 23 deletions

View File

@ -192,3 +192,20 @@ componentTest('with empty string as value', {
});
}
});
componentTest('with noneLabel', {
template: '{{combo-box content=items allowAutoSelectFirst=false noneLabel=noneLabel}}',
beforeEach() {
I18n.translations[I18n.locale].js.test = {none: 'none'};
this.set('items', ['evil', 'trout', 'hat']);
this.set('noneLabel', 'test.none');
},
test(assert) {
this.get('subject').expand();
andThen(() => {
assert.equal(this.get('subject').header().name(), 'none', 'it displays noneLabel as the header name');
});
}
});