import { cold, getTestScheduler } from 'jasmine-marbles';
const todosServiceStub = {
get() {
const todos$ = cold('--x|', { x: [{id: 1}] });
return todos$
}
};
describe('TodosComponent', () => {
it('should work', () => {
const todos = element.querySelectorAll('.todo');
const loading = element.querySelector('.loading');
expect(loading).not.toBeNull();
getTestScheduler().flush(); // flush the observables
fixture.detectChanges();
expect(element.querySelectorAll('.todo').length).toEqual(1);
expect(element.querySelectorAll('.loading').length).toEqual(0);
});
});