mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: forces boolean when content is only "true" && "false"
This commit is contained in:
parent
30fbf6fe81
commit
1be76d066c
6 changed files with 45 additions and 4 deletions
|
@ -232,6 +232,33 @@ componentTest('supports converting select value to integer', {
|
|||
}
|
||||
});
|
||||
|
||||
componentTest('supports converting string as boolean to boolean', {
|
||||
template: '{{single-select value=value content=content castBoolean=true}}',
|
||||
|
||||
beforeEach() {
|
||||
this.set('value', true);
|
||||
this.set('content', [{ id: 'true', name: 'ASC'}, {id: 'false', name: 'DESC' }]);
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
this.get('subject').expand();
|
||||
|
||||
andThen(() => assert.equal(this.get('subject').selectedRow().name(), 'ASC') );
|
||||
|
||||
andThen(() => {
|
||||
this.set('value', false);
|
||||
});
|
||||
|
||||
andThen(() => {
|
||||
assert.equal(
|
||||
this.get('subject').selectedRow().name(),
|
||||
'DESC',
|
||||
'it works with dynamic content'
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
componentTest('supports keyboard events', {
|
||||
template: '{{single-select content=content filterable=true}}',
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue