I have a problem with one test that is created from other tests similar to it, the problem is that this one particular test does not pass and I cannot understand what is causing this.
Code:
it('should call notify on the channel', done => {
httpServicePostMock.mockReturnValue({
subscribe: fn => {
fn({ data: { data: { flightPlans: flightplanss } } });
done();
},
});
const channelNotifyMock = jest.fn();
jest.spyOn(channelGateway, 'notify').mockImplementation(channelNotifyMock);
controller.addSubscriptionByDgsId('clientId', 'stand2');
expect(channelNotifyMock).toBeCalledWith(['clientId'], 'flight_plans/stand2', JSON.stringify(flightplanss));
});
});
And the error says that number of calls is equal to 0.
Maybe someone can give me a hint how to fix it?