I came across a yoda case and a test case that didn't use 'done' while
using an async call.
Fixes: https://tracker.ceph.com/issues/40828
Signed-off-by: Stephan Müller <smueller@suse.com>
expect(component).toBeTruthy();
});
- it('should focus the checkbox form field', () => {
+ it('should focus the checkbox form field', (done) => {
fixture.detectChanges();
fixture.whenStable().then(() => {
const focused = fixture.debugElement.query(By.css(':focus'));
expect(focused.attributes.type).toBe('checkbox');
const element = document.getElementById('confirmation');
expect(element === document.activeElement).toBeTruthy();
+ done();
});
});
* Expect a specific element to be visible or not.
*/
expectElementVisible(css: string, visibility: boolean) {
- expect(Boolean(this.getElementByCss(css))).toBe(visibility);
+ expect(visibility).toBe(Boolean(this.getElementByCss(css)));
}
expectFormFieldToBe(css: string, value: string) {