fix(ivy): avoid generating instructions for empty style and class bindings (#30024)
Fixes Ivy throwing an error because it tries to generate styling instructions for empty `style` and `class` bindings. This PR resolves FW-1274. PR Close #30024
This commit is contained in:

committed by
Ben Lesh

parent
a9242c4fc2
commit
63523f7964
@ -106,4 +106,28 @@ describe('styling', () => {
|
||||
const outer = element.querySelector('.outer-area');
|
||||
expect(outer.textContent.trim()).toEqual('outer');
|
||||
});
|
||||
|
||||
it('should do nothing for empty style bindings', () => {
|
||||
@Component({template: '<div [style.color]></div>'})
|
||||
class App {
|
||||
}
|
||||
|
||||
TestBed.configureTestingModule({declarations: [App]});
|
||||
const fixture = TestBed.createComponent(App);
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(fixture.nativeElement.innerHTML).toBe('<div></div>');
|
||||
});
|
||||
|
||||
it('should do nothing for empty class bindings', () => {
|
||||
@Component({template: '<div [class.is-open]></div>'})
|
||||
class App {
|
||||
}
|
||||
|
||||
TestBed.configureTestingModule({declarations: [App]});
|
||||
const fixture = TestBed.createComponent(App);
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(fixture.nativeElement.innerHTML).toBe('<div></div>');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user