selectedIssue={selectedIssue}
/>
)}
- {selectedIssue && !showIssues && (
+ {selectedIssue && !showIssues && issueLocations.length > 0 && (
<LineIssuesList
branchLike={this.props.branchLike}
issuePopup={this.props.issuePopup}
import { mockBranch } from '../../../../helpers/mocks/branch-like';
import { mockIssue, mockSourceLine } from '../../../../helpers/testMocks';
import LineCode from '../LineCode';
+import LineIssuesList from '../LineIssuesList';
it('render code', () => {
expect(shallowRender()).toMatchSnapshot();
).toMatchSnapshot('with secondary location');
});
+it('should not render issue list when no issue location', () => {
+ const wrapper = shallowRender({ issueLocations: [], showIssues: false });
+
+ expect(wrapper.find(LineIssuesList).length).toBe(0);
+});
+
function shallowRender(props: Partial<LineCode['props']> = {}) {
return shallow(
<LineCode