fix(test): fixed a test
This commit is contained in:
parent
4f2b9a4c28
commit
032f8b7840
|
@ -101,15 +101,16 @@ export function main() {
|
||||||
tb.compileAll([someComponent,
|
tb.compileAll([someComponent,
|
||||||
new ViewDefinition({
|
new ViewDefinition({
|
||||||
componentId: 'someComponent',
|
componentId: 'someComponent',
|
||||||
template: '<div with-host-actions></div>',
|
template: '<input with-host-actions></input>',
|
||||||
directives: [directiveWithHostActions]
|
directives: [directiveWithHostActions]
|
||||||
})
|
})
|
||||||
]).then( (protoViewDtos) => {
|
]).then( (protoViewDtos) => {
|
||||||
var views = tb.createRootViews(protoViewDtos);
|
var views = tb.createRootViews(protoViewDtos);
|
||||||
var componentView = views[1];
|
var componentView = views[1];
|
||||||
|
|
||||||
tb.renderer.callAction(componentView.viewRef, 0, 'setAttribute("key", "value")', null);
|
tb.renderer.callAction(componentView.viewRef, 0, 'value = "val"', null);
|
||||||
expect(DOM.getOuterHTML(tb.rootEl)).toContain('key="value"');
|
|
||||||
|
expect(DOM.getValue(DOM.childNodes(tb.rootEl)[0])).toEqual('val');
|
||||||
async.done();
|
async.done();
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
@ -177,6 +178,6 @@ var directiveWithHostActions = new DirectiveMetadata({
|
||||||
type: DirectiveMetadata.DIRECTIVE_TYPE,
|
type: DirectiveMetadata.DIRECTIVE_TYPE,
|
||||||
selector: '[with-host-actions]',
|
selector: '[with-host-actions]',
|
||||||
hostActions: MapWrapper.createFromStringMap({
|
hostActions: MapWrapper.createFromStringMap({
|
||||||
'setAttr' : 'setAttribute("key", "value")'
|
'setValue' : 'value = "val"'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue