I have a simple test:
it ('should be able to navigate to add program', fakeAsync(() => {
let href = fixture.debugElement.query(By.css('.add-program-btn'));
let link = href.nativeElement.getAttribute('href');
expect(link).toEqual('/program/new');
}));
And keep getting an error:
TypeError: Cannot read property 'nativeElement' of null
I've tried using tick()
with like 20000
, and adding fixture.detectChanges()
but nothing works. Another test that checks if a button was clicked and a function called has the same error. Is it that it can't find the element?
Everything this test is using is in Angular so I don't think it's because it's a hybrid app.
Thanks in advance.