@@ -25,6 +25,7 @@ import { withCurrentUser } from '../../../components/hoc/withCurrentUser'; | |||
import DismissableAlert from '../../../components/ui/DismissableAlert'; | |||
import { isLoggedIn } from '../../../helpers/users'; | |||
import { ProjectAlmBindingResponse } from '../../../types/alm-settings'; | |||
import { ComponentQualifier } from '../../../types/component'; | |||
import { PULL_REQUEST_DECORATION_BINDING_CATEGORY } from '../../settings/components/AdditionalCategoryKeys'; | |||
export interface FirstAnalysisNextStepsNotifProps { | |||
@@ -44,7 +45,7 @@ export function FirstAnalysisNextStepsNotif(props: FirstAnalysisNextStepsNotifPr | |||
projectBinding | |||
} = props; | |||
if (!isLoggedIn(currentUser)) { | |||
if (!isLoggedIn(currentUser) || component.qualifier !== ComponentQualifier.Project) { | |||
return null; | |||
} | |||
@@ -22,6 +22,7 @@ import { shallow } from 'enzyme'; | |||
import * as React from 'react'; | |||
import { mockProjectAlmBindingResponse } from '../../../../helpers/mocks/alm-settings'; | |||
import { mockComponent, mockCurrentUser, mockLoggedInUser } from '../../../../helpers/testMocks'; | |||
import { ComponentQualifier } from '../../../../types/component'; | |||
import { | |||
FirstAnalysisNextStepsNotif, | |||
FirstAnalysisNextStepsNotifProps | |||
@@ -29,6 +30,11 @@ import { | |||
it('should render correctly', () => { | |||
expect(shallowRender({ currentUser: mockCurrentUser() }).type()).toBeNull(); | |||
expect( | |||
shallowRender({ | |||
component: mockComponent({ qualifier: ComponentQualifier.Application }) | |||
}).type() | |||
).toBeNull(); | |||
expect(shallowRender({ detectedCIOnLastAnalysis: false })).toMatchSnapshot( | |||
'show prompt to configure CI' | |||
); |