Angular – Jasmine: Expected spy dispatch to have been called with

I’m updating create test case for update ngrx store after param available in URL. I’m getting an error as in below. Can anyone please tell me what I have missed?
Error:

Error: Expected spy dispatch to have been called with [ Object({ channelType: 'MODEL_OFFICE_APPLICATION', type: '[channelType] set channel type' }) ] but it was never called

  ngOnInit() {
    this.getUrlParam()
  };

  getUrlParam() {
    const url = window.location.href;
    let param: string;

    if (url.includes('?')) {
      const httpParams = new HttpParams({ fromString: url.split('?')[1] });
      param = httpParams.get('id');
      this.store.dispatch(
        setChannelType({ channel: CHANNEL_TYPE_MAPPER.MODEL_OFFICE_APPLICATION })
      );
    }
  }

app.spec.ts

let mockStore: MockStore<State>;
let dispatchSpy: jasmine.Spy;

  beforeEach(() => {
    mockStore = TestBed.get(Store);
    dispatchSpy = spyOn(mockStore, 'dispatch').and.callThrough();
  });

  it('should update store when param is available', () => {
    component.getUrlParam();
    expect(dispatchSpy).toHaveBeenCalledWith(
      setChannelType({
        channel: CHANNEL_TYPE_MAPPER.MODEL_OFFICE_APPLICATION
      })
    );
  });


Source: Angular Questions