Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should return the correct action and payload', done => {
// arrange
const action$ = ActionsObservable.from(
BOOTSTRAP_COMPLETE_ACTIONS.map(type => ({ type }))
);
// act
bootstrapEndEpic(action$, mockStore(), null).subscribe(action => {
// assert
expect(action.type).toBe(BOOTSTRAP_END);
expect(action.payload).toBeUndefined();
done();
});
});
});
kernels: stateModule.makeKernelsRecord({
byRef: Immutable.Map({
fake: stateModule.makeRemoteKernelRecord({
channels,
status: "connected"
})
})
})
})
}),
app: {
notificationSystem: { addNotification: jest.fn() }
}
}
};
const action$ = ActionsObservable.from([]);
const message = createExecuteRequest("source");
const observable = createExecuteCellStream(
action$,
state$.value,
message,
"id"
);
const actionBuffer = [];
observable.subscribe(x => actionBuffer.push(x), err => done.fail(err));
expect(actionBuffer).toEqual([
actions.sendExecuteRequest({ id: "id", message })
]);
done();
});
});
kernels: stateModule.makeKernelsRecord({
byRef: Immutable.Map({
fake: stateModule.makeRemoteKernelRecord({
channels,
status: "connected"
})
})
})
})
}),
app: {
notificationSystem: { addNotification: jest.fn() }
}
}
};
const action$ = ActionsObservable.from([]);
const message = createExecuteRequest("source");
const observable = createExecuteCellStream(
action$,
state$.value,
message,
"id",
"fakeContentRef"
);
const actionBuffer = [];
observable.subscribe(x => actionBuffer.push(x), err => done.fail(err));
expect(actionBuffer).toEqual([
actions.sendExecuteRequest({
id: "id",
message,
contentRef: "fakeContentRef"