lml-main
Version:
This is now a mono repository published into many standalone packages.
82 lines • 3.82 kB
JavaScript
;
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
require("rxjs");
var redux_rx_http_1 = require("redux-rx-http");
var ts_utils_1 = require("@lml/ts-utils");
var actions_1 = require("../actions");
var epics_1 = require("../epics");
var mocks_1 = require("../mocks");
describe('Job label epics', function () {
it("should " + actions_1.SET_JOB_LABEL + " with value after " + actions_1.POST_JOB_LABEL.SUCCESS, function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var result, response, action, actions;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
result = mocks_1.mockJobLabel();
response = ts_utils_1.mockResponse(result);
action = redux_rx_http_1.rxHttpSuccess(response, undefined, {
jobLabel: result,
}, actions_1.POST_JOB_LABEL);
return [4 /*yield*/, ts_utils_1.getEpicActions(epics_1.jobLabelApiEpics, action)];
case 1:
actions = _a.sent();
expect(actions).toMatchObject([
expect.objectContaining({
type: actions_1.SET_JOB_LABEL,
jobLabel: result,
}),
]);
return [2 /*return*/];
}
});
}); });
it("should " + actions_1.REMOVE_JOB_LABEL + " after " + actions_1.DELETE_JOB_LABEL.SUCCESS, function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var result, response, action, actions;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
result = mocks_1.mockJobLabel();
response = ts_utils_1.mockResponse(result);
action = redux_rx_http_1.rxHttpSuccess(response, undefined, {
jobLabel: result,
}, actions_1.DELETE_JOB_LABEL);
return [4 /*yield*/, ts_utils_1.getEpicActions(epics_1.jobLabelApiEpics, action)];
case 1:
actions = _a.sent();
expect(actions).toMatchObject([
expect.objectContaining({
type: actions_1.REMOVE_JOB_LABEL,
jobLabel: result,
}),
]);
return [2 /*return*/];
}
});
}); });
it("should " + actions_1.SET_JOB_LABEL + " after " + actions_1.PUT_JOB_LABEL.SUCCESS, function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var result, response, action, actions;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
result = mocks_1.mockJobLabel();
response = ts_utils_1.mockResponse(result);
action = redux_rx_http_1.rxHttpSuccess(response, undefined, {
jobLabel: result,
}, actions_1.PUT_JOB_LABEL);
return [4 /*yield*/, ts_utils_1.getEpicActions(epics_1.jobLabelApiEpics, action)];
case 1:
actions = _a.sent();
expect(actions).toMatchObject([
expect.objectContaining({
type: actions_1.SET_JOB_LABEL,
jobLabel: result,
}),
]);
return [2 /*return*/];
}
});
}); });
});
//# sourceMappingURL=epic.spec.js.map