feat(renderer): add a setElementStyles
method
This commit is contained in:
@ -134,7 +134,7 @@ export function main() {
|
||||
});
|
||||
}));
|
||||
|
||||
it('should update any element property/attributes/class/style independent of the compilation on the root element and other elements',
|
||||
it('should update any element property/attributes/class/style(s) independent of the compilation on the root element and other elements',
|
||||
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
|
||||
tcb.overrideView(MyComp2, new ViewMetadata(
|
||||
{template: '<input [title]="y" style="position:absolute">'}))
|
||||
@ -156,6 +156,15 @@ export function main() {
|
||||
renderer.setElementStyle(workerEl, 'width', null);
|
||||
expect(getDOM().getStyle(el, 'width')).toEqual('');
|
||||
|
||||
renderer.setElementStyles(workerEl, {'height': '999px', 'opacity': '0.5'})
|
||||
expect(getDOM().getStyle(el, 'height'))
|
||||
.toEqual('999px');
|
||||
expect(getDOM().getStyle(el, 'opacity')).toEqual('0.5');
|
||||
renderer.setElementStyles(workerEl, {'height': '999px', 'opacity': null});
|
||||
expect(getDOM().getStyle(el, 'height'))
|
||||
.toEqual('999px');
|
||||
expect(getDOM().getStyle(el, 'opacity')).toEqual('');
|
||||
|
||||
renderer.setElementAttribute(workerEl, 'someattr', 'someValue');
|
||||
expect(getDOM().getAttribute(el, 'someattr')).toEqual('someValue');
|
||||
};
|
||||
|
Reference in New Issue
Block a user