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] Merge header components #57816

Merged
merged 23 commits into from
Feb 19, 2020
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Test title when canceled
cnasikas committed Feb 19, 2020
commit 4d940bd67c5364cf1cd19264c13daa68145d2fce
Original file line number Diff line number Diff line change
@@ -137,6 +137,30 @@ describe('EditableTitle', () => {
).toEqual(newTitle);
});

cnasikas marked this conversation as resolved.
Show resolved Hide resolved
test('it should NOT change the title when cancel', () => {
const title = 'Test title';
const newTitle = 'new test title';

const wrapper = mount(
<TestProviders>
<EditableTitle title={title} onSubmit={submitTitle} isLoading={false} />
</TestProviders>
);

wrapper.find('button[data-test-subj="editable-title-edit-icon"]').simulate('click');
wrapper.update();

wrapper
.find('input[data-test-subj="editable-title-input-field"]')
.simulate('change', { target: { value: newTitle } });
wrapper.update();

wrapper.find('button[data-test-subj="editable-title-cancel-btn"]').simulate('click');
wrapper.update();

expect(wrapper.find('h1[data-test-subj="header-page-title"]').text()).toEqual(title);
});

test('it submits the title', () => {
const newTitle = 'new test title';