I'm updating a repo that used to use Angular 8.
In a test, using TestBed, I'm checking if a class exists using:
fixture.debugElement.classes['my-class'].toBe(false)
After updating to Angular 9, this test no longer works, as the expression no longer returns false when the class doesn't exist, it returns undefined.
I've fixed the test using:
fixture.debugElement.classes['my-class'].toBeFalsy()
by i'm afraid something else is failing silenty.
Checking Angular documentation, classes should only return a boolean:
classes: {
[key: string]: boolean;
}
Is there any situation where classes
will return undefined?