4 'modules/nodePane/metaWidget/metaWidget'
5 ], function(chai, sinon, metaWidget) {
9 var assert = chai.assert;
11 describe('metaWidget', function() {
12 it('calls calls registered callback on value change', function() {
14 var widget = metaWidget.create({
16 attrs: {'uri': {type: 'string', value: 'test string'}},
19 var spy = sinon.spy();
20 widget.on('valueChanged', spy);
21 var input = dom.find('input');
24 assert.ok(spy.calledOnce, 'called once');
25 assert.ok(spy.calledWith('uri', 'test string'), 'called with');
28 input.val('new val').change();
29 assert.ok(spy.calledOnce, 'called once');
30 assert.ok(spy.calledWith('uri', 'new val'), 'called with new val');