mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-28 04:46:57 -04:00
add tests for select component
This commit is contained in:
@@ -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