5 'modules/nodePane/metaWidget/metaWidget'
6 ], function($, chai, sinon, metaWidget) {
9 /* globals describe, it */
11 var assert = chai.assert;
13 describe('metaWidget', function() {
14 it('calls calls registered callback on value change', function() {
16 var widget = metaWidget.create({
18 attrs: {'uri': {type: 'string', value: 'test string'}},
21 var spy = sinon.spy();
22 widget.on('valueChanged', spy);
23 var input = dom.find('input');
26 assert.ok(spy.calledOnce, 'called once');
27 assert.ok(spy.calledWith('uri', 'test string'), 'called with');
30 input.val('new val').change();
31 assert.ok(spy.calledOnce, 'called once');
32 assert.ok(spy.calledWith('uri', 'new val'), 'called with new val');