-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[7.x] [Security Solutions][Cases - Timeline] Fix bug when adding a ti…
…meline to a case (#76967) (#77547) Co-authored-by: Gloria Hornero <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Gloria Hornero <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
12ff04e
commit c673681
Showing
22 changed files
with
2,941 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
x-pack/plugins/security_solution/cypress/integration/timeline_attach_to_case.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* 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 { loginAndWaitForTimeline } from '../tasks/login'; | ||
import { | ||
attachTimelineToNewCase, | ||
attachTimelineToExistingCase, | ||
addNewCase, | ||
selectCase, | ||
} from '../tasks/timeline'; | ||
import { DESCRIPTION_INPUT } from '../screens/create_new_case'; | ||
import { esArchiverLoad, esArchiverUnload } from '../tasks/es_archiver'; | ||
import { caseTimeline, TIMELINE_CASE_ID } from '../objects/case'; | ||
|
||
describe('attach timeline to case', () => { | ||
beforeEach(() => { | ||
loginAndWaitForTimeline(caseTimeline.id); | ||
}); | ||
context('without cases created', () => { | ||
before(() => { | ||
esArchiverLoad('timeline'); | ||
}); | ||
|
||
after(() => { | ||
esArchiverUnload('timeline'); | ||
}); | ||
|
||
it('attach timeline to a new case', () => { | ||
attachTimelineToNewCase(); | ||
|
||
cy.location('origin').then((origin) => { | ||
cy.get(DESCRIPTION_INPUT).should( | ||
'have.text', | ||
`[${caseTimeline.title}](${origin}/app/security/timelines?timeline=(id:'${caseTimeline.id}',isOpen:!t))` | ||
); | ||
}); | ||
}); | ||
|
||
it('attach timeline to an existing case with no case', () => { | ||
attachTimelineToExistingCase(); | ||
addNewCase(); | ||
|
||
cy.location('origin').then((origin) => { | ||
cy.get(DESCRIPTION_INPUT).should( | ||
'have.text', | ||
`[${caseTimeline.title}](${origin}/app/security/timelines?timeline=(id:'${caseTimeline.id}',isOpen:!t))` | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
context('with cases created', () => { | ||
before(() => { | ||
esArchiverLoad('case_and_timeline'); | ||
}); | ||
|
||
after(() => { | ||
esArchiverUnload('case_and_timeline'); | ||
}); | ||
|
||
it('attach timeline to an existing case', () => { | ||
attachTimelineToExistingCase(); | ||
selectCase(TIMELINE_CASE_ID); | ||
|
||
cy.location('origin').then((origin) => { | ||
cy.get(DESCRIPTION_INPUT).should( | ||
'have.text', | ||
`[${caseTimeline.title}](${origin}/app/security/timelines?timeline=(id:'${caseTimeline.id}',isOpen:!t))` | ||
); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.