UNPKG

lml-main

Version:

This is now a mono repository published into many standalone packages.

25 lines 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var faker_1 = require("faker"); var mocks_1 = require("../mocks"); var actions_1 = require("../actions"); var reducers_1 = require("../reducers"); describe('Allocation tag reducer', function () { it('should save a single tag by job id', function () { var tag = mocks_1.mockAllocation('TAG'); var action = actions_1.setTagById(tag); var state = reducers_1.allocationTagReducer(reducers_1.initialAllocationTagState, action); var res = state.byJobId[tag.job.refId]; expect(res).toEqual(tag); }); it('should save a batch of tags by job id', function () { var jobRefId = faker_1.random.uuid(); var tag = mocks_1.mockAllocation('TAG'); var action = actions_1.setTagsByIdBatch((_a = {}, _a[jobRefId] = tag, _a)); var state = reducers_1.allocationTagReducer(reducers_1.initialAllocationTagState, action); var res = state.byJobId[jobRefId]; expect(res).toEqual(tag); var _a; }); }); //# sourceMappingURL=tag.reducer.spec.js.map