Skip to content

Commit

Permalink
unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
angorayc committed Sep 10, 2021
1 parent 3f144f1 commit 030b001
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
EuiBadge,
} from '@elastic/eui';
import { isEmpty } from 'lodash/fp';
import React, { useState, useMemo, useEffect, useCallback } from 'react';
import React, { useMemo, useEffect, useCallback } from 'react';
import styled from 'styled-components';
import { Dispatch } from 'redux';
import { connect, ConnectedProps, useDispatch } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ export const addTimelineToStore = ({
return {
...timelineById,
[id]: {
...(timelineById[id] ? timelineById[id] : {}),
...timeline,
filterManager: timelineById[id].filterManager,
isLoading: timelineById[id].isLoading,
initialized: timelineById[id].initialized,
dateRange:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const basicTimeline: TimelineModel = {
eventIdToNoteIds: {},
excludedRowRendererIds: [],
expandedDetail: {},
filterManager: 'mockFilterManager',
highlightedDropAndProviderId: '',
historyIds: [],
id: 'foo',
Expand Down Expand Up @@ -194,6 +195,20 @@ describe('Timeline', () => {
},
});
});

test('should contain existing filterManager', () => {
const update = addTimelineToStore({
id: 'foo',
timeline: {
...basicTimeline,
status: TimelineStatus.immutable,
timelineType: TimelineType.template,
},
timelineById: timelineByIdMock,
});

expect(update.foo.filterManager).toEqual('mockFilterManager');
});
});

describe('#addNewTimeline', () => {
Expand Down

0 comments on commit 030b001

Please sign in to comment.