testing that a component method calls another method

it("should foobar", () => {
    const spy = spyOn(component, "bar");
    component.foo();
    expect(spy).toHaveBeenCalled();
  });

You need to set up the spy before the method is called. Jasmine spys wrap function to determine when they are called and what they get called with. The method must be wrapped before the spied on method is called in order to capture the information. Try changing your test to match the following:

it('should foobar', () => {
    spyOn(component, 'bar');
    component.foo();
    expect(component.bar).toHaveBeenCalled();
})