Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykkopycinski committed Jan 7, 2020
1 parent 474549b commit 9f8a7a7
Showing 1 changed file with 27 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,30 @@ describe('Events', () => {

test('renders correctly against snapshot', () => {
const wrapper = shallow(
<FormattedFieldValue
eventId={mockTimelineData[0].ecs._id}
contextId="test"
fieldName="timestamp"
fieldType="date"
value={get('timestamp', mockTimelineData[0].ecs)}
/>
<TestProviders>
<FormattedFieldValue
eventId={mockTimelineData[0].ecs._id}
contextId="test"
fieldName="timestamp"
fieldType="date"
value={get('timestamp', mockTimelineData[0].ecs)}
/>
</TestProviders>
);
expect(toJson(wrapper)).toMatchSnapshot();
});

test('it renders a localized date tooltip for a field type of date that has a valid timestamp', () => {
const wrapper = mount(
<FormattedFieldValue
eventId={mockTimelineData[0].ecs._id}
contextId="test"
fieldName="timestamp"
fieldType="date"
value={get('timestamp', mockTimelineData[0].ecs)}
/>
<TestProviders>
<FormattedFieldValue
eventId={mockTimelineData[0].ecs._id}
contextId="test"
fieldName="timestamp"
fieldType="date"
value={get('timestamp', mockTimelineData[0].ecs)}
/>
</TestProviders>
);

expect(wrapper.find('[data-test-subj="localized-date-tool-tip"]').exists()).toEqual(true);
Expand Down Expand Up @@ -230,13 +234,15 @@ describe('Events', () => {

test('it renders a hyperlink to the hosts details page when fieldName is host.name, and a hostname is provided', () => {
const wrapper = mount(
<FormattedFieldValue
eventId={mockTimelineData[0].ecs._id}
contextId="test"
fieldName={HOST_NAME_FIELD_NAME}
fieldType="text"
value={'some-hostname'}
/>
<TestProviders>
<FormattedFieldValue
eventId={mockTimelineData[0].ecs._id}
contextId="test"
fieldName={HOST_NAME_FIELD_NAME}
fieldType="text"
value={'some-hostname'}
/>
</TestProviders>
);
expect(wrapper.find('[data-test-subj="host-details-link"]').exists()).toEqual(true);
});
Expand Down

0 comments on commit 9f8a7a7

Please sign in to comment.