-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Ingest Manager][SECURITY SOLUTION] adjust config reassign link and add roundtrip to Reassignment flow #70208
Changes from 3 commits
eabf90b
24c31dc
6584b38
a8d49c2
507c7d1
413bf37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,6 +210,7 @@ describe('when on the hosts page', () => { | |
|
||
describe('when there is a selected host in the url', () => { | ||
let hostDetails: HostInfo; | ||
let agentId: string; | ||
const dispatchServerReturnedHostPolicyResponse = ( | ||
overallStatus: HostPolicyResponseActionStatus = HostPolicyResponseActionStatus.success | ||
) => { | ||
|
@@ -274,6 +275,8 @@ describe('when on the hosts page', () => { | |
}, | ||
}; | ||
|
||
agentId = hostDetails.metadata.elastic.agent.id; | ||
|
||
coreStart.http.get.mockReturnValue(Promise.resolve(hostDetails)); | ||
coreStart.application.getUrlForApp.mockReturnValue('/app/logs'); | ||
|
||
|
@@ -404,6 +407,32 @@ describe('when on the hosts page', () => { | |
).not.toBeNull(); | ||
}); | ||
|
||
it('should include the link to reassignment in Ingest', async () => { | ||
coreStart.application.getUrlForApp.mockReturnValue('/app/ingestManager'); | ||
const renderResult = render(); | ||
const linkToLogs = await renderResult.findByTestId('hostDetailsLinkToIngest'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probs want to rename this const to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you are correct, updated to have a name that makes sense |
||
expect(linkToLogs).not.toBeNull(); | ||
expect(linkToLogs.textContent).toEqual('Reassign Policy'); | ||
expect(linkToLogs.getAttribute('href')).toEqual( | ||
`/app/ingestManager#/fleet/agents/${agentId}/activity?openReassignFlyout=true` | ||
); | ||
}); | ||
|
||
describe('when link to reassignment in Ingest is clicked', () => { | ||
beforeEach(async () => { | ||
coreStart.application.getUrlForApp.mockReturnValue('/app/ingestManager'); | ||
const renderResult = render(); | ||
const linkToLogs = await renderResult.findByTestId('hostDetailsLinkToIngest'); | ||
reactTestingLibrary.act(() => { | ||
reactTestingLibrary.fireEvent.click(linkToLogs); | ||
}); | ||
}); | ||
|
||
it('should navigate to logs without full page refresh', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wait can you take out There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops, done |
||
expect(coreStart.application.navigateToApp.mock.calls).toHaveLength(1); | ||
}); | ||
}); | ||
|
||
it('should include the link to logs', async () => { | ||
const renderResult = render(); | ||
const linkToLogs = await renderResult.findByTestId('hostDetailsLinkToLogs'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So is this file where all of the round trips are registered basically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is where you define the types for which actions a page will support
EDIT:
This line is where you define each callback https://github.com/elastic/kibana/pull/70208/files#diff-a3e3c11e8b58a9e2af3af104ab58a81dR110
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noice