Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SIEM] [Case] Initial UI #57283

Merged
merged 80 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
8fdb146
initial case ui in siem
stephmilovic Jan 9, 2020
52e388b
get cases
stephmilovic Jan 10, 2020
6ccb205
cases table
stephmilovic Jan 10, 2020
0f693d7
Merge branch 'master' into case-siem-ui
stephmilovic Jan 13, 2020
d644cc2
merge master
stephmilovic Jan 15, 2020
39e1cf7
add sorting
stephmilovic Jan 16, 2020
6da1905
table working better
stephmilovic Jan 16, 2020
17edc5b
sorting by date created
stephmilovic Jan 16, 2020
fe70b50
trying to get routing working
stephmilovic Jan 20, 2020
1de7a1c
merge master
stephmilovic Jan 20, 2020
519c424
routing fixed
stephmilovic Jan 20, 2020
43da477
fixing
stephmilovic Jan 20, 2020
f31c254
using saved object api, switching
stephmilovic Jan 21, 2020
11d5721
using hooks, need to fix perPage
stephmilovic Jan 21, 2020
fdb0f1b
fixed per page
stephmilovic Jan 22, 2020
d6160de
server down so removing server changes =P
stephmilovic Jan 22, 2020
18e621e
remove case graphql
stephmilovic Jan 22, 2020
ed8a741
merge master
stephmilovic Jan 22, 2020
834770a
more refactor
stephmilovic Jan 22, 2020
3898076
search bar implementation
stephmilovic Jan 22, 2020
3d66bbb
merge in master
stephmilovic Jan 23, 2020
b3e3ba1
reorg dirs
stephmilovic Jan 23, 2020
0e6cce1
basic table
stephmilovic Jan 23, 2020
90926e3
pretty up table
stephmilovic Jan 23, 2020
a9fdcc6
ready for hw
stephmilovic Jan 24, 2020
4b5647c
Merge branch 'master' into case-siem-ui-v2
stephmilovic Jan 24, 2020
3a3ceb9
[SIEM][CASE] Add package.json to fix lodash dependencies issues
cnasikas Jan 28, 2020
636e3c2
[SIEM][CASE] Add case base url to constants
cnasikas Jan 30, 2020
992765d
[SIEM][CASE] Create PaginationOptions interface
cnasikas Jan 30, 2020
48bf037
[SIEM][CASE] Create Case interface
cnasikas Jan 30, 2020
ab2df75
[SIEM][CASE] Create FetchCaseProps interface
cnasikas Jan 30, 2020
2d422bf
[SIEM][CASE] Create FetchCasesResponse interface
cnasikas Jan 30, 2020
4ba52a9
[SIEM][CASE] Add saved_object to cases response
cnasikas Jan 30, 2020
07f3aa7
[SIEM][CASE] Move types
cnasikas Jan 30, 2020
7530ef9
[SIEM][CASE] Create api
cnasikas Jan 30, 2020
3a5c377
[SIEM][CASE] Use api
cnasikas Jan 30, 2020
987fdd2
[SIEM][CASE] Add capability to API to filter by tags
cnasikas Jan 31, 2020
c8c3f99
[SIEM][CASE] Add constant
cnasikas Jan 31, 2020
68f1a17
[SIEM][CASE] Add FilterOptions to payload
cnasikas Jan 31, 2020
24e2515
[SIEM][CASE] Update filter options on reducer
cnasikas Jan 31, 2020
fb4cddf
[SIEM][CASE] Dispatch filter changes
cnasikas Jan 31, 2020
705a313
[SIEM][CASE] Filter options from UI table
cnasikas Jan 31, 2020
420ff68
set up search field
stephmilovic Feb 3, 2020
db80bff
add new page for create case
stephmilovic Feb 3, 2020
aaf9dc1
wip, form panel
stephmilovic Feb 4, 2020
859f7ef
create new case page added
stephmilovic Feb 4, 2020
d04b7ab
merge in master
stephmilovic Feb 4, 2020
ae7938d
markdown support
stephmilovic Feb 4, 2020
019ac5d
Merge branch 'master' into case-siem-ui-v2
stephmilovic Feb 4, 2020
454505f
fix lint and type issues
stephmilovic Feb 4, 2020
fa87229
adding update hook
stephmilovic Feb 5, 2020
6a8ca8a
update case added
stephmilovic Feb 6, 2020
7c3d2be
Merge branch 'master' into case-siem-ui-v2
stephmilovic Feb 6, 2020
3dd0f5a
working on user action tree component
stephmilovic Feb 7, 2020
db634f0
user action tree
stephmilovic Feb 7, 2020
810e3b1
case details
stephmilovic Feb 8, 2020
a8c935c
new header
stephmilovic Feb 8, 2020
dc3a58f
improve update case hook
stephmilovic Feb 8, 2020
6780ff9
update title and tags
stephmilovic Feb 9, 2020
97ec855
chrome removed from case api
stephmilovic Feb 10, 2020
fb52eb0
Merge branch 'master' into case-siem-ui-v2
stephmilovic Feb 10, 2020
2bf0256
code cleanup about to pr
stephmilovic Feb 10, 2020
0ab62d8
prepare for pr
stephmilovic Feb 10, 2020
1ec9a53
fix translations issue
stephmilovic Feb 11, 2020
4bd8f33
about to refactor and flatten
stephmilovic Feb 11, 2020
bfc4a38
flatten on server side
stephmilovic Feb 12, 2020
3485fd7
some clean up + type fixing
XavierM Feb 12, 2020
d7e6630
fix tests
stephmilovic Feb 12, 2020
e442a02
Merge branch 'master' into case-siem-ui-v2
stephmilovic Feb 12, 2020
31f5e6b
comment out case indexes
stephmilovic Feb 12, 2020
202efd1
remove unnecessary lodash
stephmilovic Feb 13, 2020
aac10e2
remove case index pattern from siem
stephmilovic Feb 13, 2020
4de5297
Timestamps to Zulu time
cnasikas Feb 13, 2020
21dfccc
update test for zulu time
stephmilovic Feb 13, 2020
bb7ec0b
Merge branch 'case-siem-ui-v2' of github.com:stephmilovic/kibana into…
stephmilovic Feb 13, 2020
e595f8a
pr changes
stephmilovic Feb 13, 2020
2e558d2
Remove case_type attribute
cnasikas Feb 13, 2020
f878b4e
last pr fixes
stephmilovic Feb 13, 2020
2f09c06
Merge branch 'case-siem-ui-v2' of github.com:stephmilovic/kibana into…
stephmilovic Feb 13, 2020
807b2ce
rm index patterns
stephmilovic Feb 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json';
import { shallow } from 'enzyme';
import React from 'react';

import { TestProviders } from '../../mock';
import { HeaderPage } from './index';
import { useMountAppended } from '../../utils/use_mount_appended';

describe('HeaderPage', () => {
const mount = useMountAppended();

test('it renders', () => {
const wrapper = shallow(
<HeaderPage
badgeOptions={{ beta: true, text: 'Beta', tooltip: 'Test tooltip' }}
border
subtitle="Test subtitle"
subtitle2="Test subtitle 2"
title="Test title"
>
<p>{'Test supplement'}</p>
</HeaderPage>
);

expect(wrapper).toMatchSnapshot();
});

test('it renders the title', () => {
const wrapper = mount(
<TestProviders>
<HeaderPage title="Test title" />
</TestProviders>
);

expect(
wrapper
.find('[data-test-subj="header-page-title"]')
.first()
.exists()
).toBe(true);
});

test('it renders the back link when provided', () => {
const wrapper = mount(
<TestProviders>
<HeaderPage backOptions={{ href: '#', text: 'Test link' }} title="Test title" />
</TestProviders>
);

expect(
wrapper
.find('.siemHeaderPage__linkBack')
.first()
.exists()
).toBe(true);
});

test('it DOES NOT render the back link when not provided', () => {
const wrapper = mount(
<TestProviders>
<HeaderPage title="Test title" />
</TestProviders>
);

expect(
wrapper
.find('.siemHeaderPage__linkBack')
.first()
.exists()
).toBe(false);
});

test('it renders the first subtitle when provided', () => {
const wrapper = mount(
<TestProviders>
<HeaderPage subtitle="Test subtitle" title="Test title" />
</TestProviders>
);

expect(
wrapper
.find('[data-test-subj="header-page-subtitle"]')
.first()
.exists()
).toBe(true);
});

test('it DOES NOT render the first subtitle when not provided', () => {
const wrapper = mount(
<TestProviders>
<HeaderPage title="Test title" />
</TestProviders>
);

expect(
wrapper
.find('[data-test-subj="header-section-subtitle"]')
.first()
.exists()
).toBe(false);
});

test('it renders the second subtitle when provided', () => {
const wrapper = mount(
<TestProviders>
<HeaderPage subtitle2="Test subtitle 2" title="Test title" />
</TestProviders>
);

expect(
wrapper
.find('[data-test-subj="header-page-subtitle-2"]')
.first()
.exists()
).toBe(true);
});

test('it DOES NOT render the second subtitle when not provided', () => {
const wrapper = mount(
<TestProviders>
<HeaderPage title="Test title" />
</TestProviders>
);

expect(
wrapper
.find('[data-test-subj="header-section-subtitle-2"]')
.first()
.exists()
).toBe(false);
});

test('it renders supplements when children provided', () => {
const wrapper = mount(
<TestProviders>
<HeaderPage title="Test title">
<p>{'Test supplement'}</p>
</HeaderPage>
</TestProviders>
);

expect(
wrapper
.find('[data-test-subj="header-page-supplements"]')
.first()
.exists()
).toBe(true);
});

test('it DOES NOT render supplements when children not provided', () => {
const wrapper = mount(
<TestProviders>
<HeaderPage title="Test title" />
</TestProviders>
);

expect(
wrapper
.find('[data-test-subj="header-page-supplements"]')
.first()
.exists()
).toBe(false);
});

test('it applies border styles when border is true', () => {
const wrapper = mount(
<TestProviders>
<HeaderPage border title="Test title" />
</TestProviders>
);
const siemHeaderPage = wrapper.find('.siemHeaderPage').first();

expect(siemHeaderPage).toHaveStyleRule('border-bottom', euiDarkVars.euiBorderThin);
expect(siemHeaderPage).toHaveStyleRule('padding-bottom', euiDarkVars.paddingSizes.l);
});

test('it DOES NOT apply border styles when border is false', () => {
const wrapper = mount(
<TestProviders>
<HeaderPage title="Test title" />
</TestProviders>
);
const siemHeaderPage = wrapper.find('.siemHeaderPage').first();

expect(siemHeaderPage).not.toHaveStyleRule('border-bottom', euiDarkVars.euiBorderThin);
expect(siemHeaderPage).not.toHaveStyleRule('padding-bottom', euiDarkVars.paddingSizes.l);
});

test('it renders as a draggable when arguments provided', () => {
const wrapper = mount(
<TestProviders>
<HeaderPage draggableArguments={{ field: 'neat', value: 'cool' }} title="Test title" />
</TestProviders>
);

expect(
wrapper
.find('[data-test-subj="header-page-draggable"]')
.first()
.exists()
).toBe(true);
});

test('it DOES NOT render as a draggable when arguments not provided', () => {
const wrapper = mount(
<TestProviders>
<HeaderPage title="Test title" />
</TestProviders>
);

expect(
wrapper
.find('[data-test-subj="header-page-draggable"]')
.first()
.exists()
).toBe(false);
});
});
Loading