mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-28 04:46:57 -04:00
Merge remote-tracking branch 'origin/master' into #47/range-slider-component
# Conflicts: # index.js
This commit is contained in:
@@ -7,6 +7,7 @@ var HTML = require('../../../src/scripts/vendor/minified').HTML;
|
||||
var components = require('../../../src/scripts/components');
|
||||
var manipulators = require('../../../src/scripts/lib/manipulators');
|
||||
var fixture = require('../../fixture');
|
||||
var sinon = require('sinon');
|
||||
|
||||
var componentSchema = Joi.object().keys({
|
||||
name: Joi.string().required(),
|
||||
@@ -39,6 +40,20 @@ describe('components', function() {
|
||||
it('is able to be passed to ClayConfig', function() {
|
||||
fixture.clayConfig([component.name]);
|
||||
});
|
||||
|
||||
it('only has one $manipulatorTarget', function() {
|
||||
var configItem = fixture.clayConfig([component.name]).getAllItems()[0];
|
||||
assert.strictEqual(configItem.$manipulatorTarget.length, 1);
|
||||
});
|
||||
|
||||
it('only dispatches change events once', function() {
|
||||
var configItem = fixture.clayConfig([component.name]).getAllItems()[0];
|
||||
var handler = sinon.spy();
|
||||
configItem.on('change', handler);
|
||||
configItem.trigger('change');
|
||||
assert.strictEqual(handler.callCount, 1);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user