mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 20:41:24 +08:00
FEATURE: Multiple embeddable hosts
- Also refactors two site settings components into one, with tests
This commit is contained in:
31
test/javascripts/components/value-list-test.js.es6
Normal file
31
test/javascripts/components/value-list-test.js.es6
Normal file
@ -0,0 +1,31 @@
|
||||
moduleForComponent('value-list', {integration: true});
|
||||
|
||||
test('functionality', function(assert) {
|
||||
andThen(() => {
|
||||
this.render('{{value-list value=values}}');
|
||||
});
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(this.$('.values .value').length === 0, 'it has no values');
|
||||
assert.ok(this.$('input').length, 'it renders the input');
|
||||
assert.ok(this.$('.btn-primary[disabled]').length, 'it is disabled with no value');
|
||||
});
|
||||
|
||||
fillIn('input', 'eviltrout');
|
||||
andThen(() => {
|
||||
assert.ok(!this.$('.btn-primary[disabled]').length, "it isn't disabled anymore");
|
||||
});
|
||||
|
||||
click('.btn-primary');
|
||||
andThen(() => {
|
||||
assert.ok(this.$('.values .value').length === 1, 'it adds the value');
|
||||
assert.ok(this.$('input').val() === '', 'it clears the input');
|
||||
assert.ok(this.$('.btn-primary[disabled]').length, "it is disabled again");
|
||||
});
|
||||
|
||||
click('.value .btn-small');
|
||||
andThen(() => {
|
||||
assert.ok(this.$('.values .value').length === 0, 'it removes the value');
|
||||
});
|
||||
|
||||
});
|
Reference in New Issue
Block a user