mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 01:17:16 +08:00
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:
@ -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');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user