-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Connectors][ServiceNow] Update store links #117374
Changes from 4 commits
5d648c5
c5e58ef
6cecc5f
0817ea7
81937bf
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 |
---|---|---|
|
@@ -9,22 +9,32 @@ import React from 'react'; | |
import { render, screen } from '@testing-library/react'; | ||
import { ApplicationRequiredCallout } from './application_required_callout'; | ||
|
||
const appId = 'test'; | ||
|
||
describe('ApplicationRequiredCallout', () => { | ||
test('it renders the callout', () => { | ||
render(<ApplicationRequiredCallout />); | ||
render(<ApplicationRequiredCallout appId={appId} />); | ||
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. If this ids is something which will never change, then I think the better approach to avoid passing this as props and just use a constants 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. The reason I pass the id as a pros is that the component is used by both the ITSM & SecOps so it is different for each connector. Do you want me to do something different? 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. Thank you for the explanation. It seems to be right. |
||
expect(screen.getByText('Elastic ServiceNow App not installed')).toBeInTheDocument(); | ||
expect( | ||
screen.getByText('Please go to the ServiceNow app store and install the application') | ||
).toBeInTheDocument(); | ||
}); | ||
|
||
test('it renders the ServiceNow store button', () => { | ||
render(<ApplicationRequiredCallout />); | ||
render(<ApplicationRequiredCallout appId={appId} />); | ||
expect(screen.getByText('Visit ServiceNow app store')).toBeInTheDocument(); | ||
}); | ||
|
||
it('should render with correct href for the ServiceNow store button', () => { | ||
render(<ApplicationRequiredCallout appId={appId} />); | ||
expect(screen.getByRole('link')).toHaveAttribute( | ||
'href', | ||
'https://store.servicenow.com/sn_appstore_store.do#!/store/application/test' | ||
); | ||
}); | ||
|
||
test('it renders an error message if provided', () => { | ||
render(<ApplicationRequiredCallout message="Denied" />); | ||
render(<ApplicationRequiredCallout message="Denied" appId={appId} />); | ||
expect(screen.getByText('Error message: Denied')).toBeInTheDocument(); | ||
}); | ||
}); |
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.
Wonder why this is optional...
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.
I make it optional because ITOM does not have an application.