mirror of
https://github.com/pebble-dev/clay.git
synced 2026-10-26 22:59:56 -04:00
add tests for select component
This commit is contained in:
1 parent
ef69c6afff
commit
80df838d52
1 file changed
+24
@@ -0,0 +1,24 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var assert = require('chai').assert;
|
||||||
|
var fixture = require('../../fixture');
|
||||||
|
|
||||||
|
describe('component - color', function() {
|
||||||
|
it('sets the value display to the correct value on change', function() {
|
||||||
|
var clayConfig = fixture.clayConfig([
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
value: 'value-1',
|
||||||
|
options: [
|
||||||
|
{ label: 'label 1', value: 'value-1' },
|
||||||
|
{ label: 'label 2', value: 'value-2' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
var selectItem = clayConfig.getItemsByType('select')[0];
|
||||||
|
var $valueDisplay = selectItem.$element.select('.value');
|
||||||
|
assert.strictEqual($valueDisplay.get('innerHTML'), 'label 1');
|
||||||
|
selectItem.set('value-2');
|
||||||
|
assert.strictEqual($valueDisplay.get('innerHTML'), 'label 2');
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in new issue
Block a user