@@ -43,13 +43,15 @@ export default class LineCoverage extends React.PureComponent { | |||
const className = | |||
'source-meta source-line-coverage' + | |||
(line.coverageStatus != null ? ` source-line-${line.coverageStatus}` : ''); | |||
const hasPopup = | |||
line.coverageStatus === 'covered' || line.coverageStatus === 'partially-covered'; | |||
const cell = ( | |||
<td | |||
className={className} | |||
data-line-number={line.line} | |||
role={line.coverageStatus != null ? 'button' : undefined} | |||
tabIndex={line.coverageStatus != null ? 0 : undefined} | |||
onClick={line.coverageStatus != null ? this.handleClick : undefined}> | |||
role={hasPopup ? 'button' : undefined} | |||
tabIndex={hasPopup ? 0 : undefined} | |||
onClick={hasPopup ? this.handleClick : undefined}> | |||
<div className="source-line-bar" /> | |||
</td> | |||
); |
@@ -36,8 +36,6 @@ it('render uncovered line', () => { | |||
const onClick = jest.fn(); | |||
const wrapper = shallow(<LineCoverage line={line} onClick={onClick} />); | |||
expect(wrapper).toMatchSnapshot(); | |||
click(wrapper.find('[tabIndex]')); | |||
expect(onClick).toHaveBeenCalled(); | |||
}); | |||
it('render line with unknown coverage', () => { |
@@ -38,9 +38,6 @@ exports[`render uncovered line 1`] = ` | |||
<td | |||
className="source-meta source-line-coverage source-line-uncovered" | |||
data-line-number={3} | |||
onClick={[Function]} | |||
role="button" | |||
tabIndex={0} | |||
> | |||
<div | |||
className="source-line-bar" |
@@ -1,19 +1,11 @@ | |||
<div class="bubble-popup-container"> | |||
<div class="bubble-popup-title"> | |||
{{#if row.lineHits}} | |||
{{#each testFiles}} | |||
<div class="bubble-popup-title"> | |||
{{t 'source_viewer.covered'}} | |||
{{#if row.conditions}} | |||
({{default row.coveredConditions 0}} of {{row.conditions}} {{t 'source_viewer.conditions'}}) | |||
{{/if}} | |||
{{else}} | |||
{{t 'source_viewer.not_covered'}} | |||
{{#if row.conditions}} | |||
({{row.conditions}} {{t 'source_viewer.conditions'}}) | |||
{{/if}} | |||
{{/if}} | |||
</div> | |||
{{#each testFiles}} | |||
</div> | |||
<div class="bubble-popup-section"> | |||
<a class="component-viewer-popup-test-file link-action" data-key="{{file.key}}" title="{{file.longName}}"> | |||
<span>{{collapsePath file.longName}}</span> | |||
@@ -33,6 +25,8 @@ | |||
{{/each}} | |||
</ul> | |||
</div> | |||
{{else}} | |||
{{t 'source_viewer.tooltip.no_information_about_tests'}} | |||
{{/each}} | |||
</div> | |||
@@ -2020,15 +2020,16 @@ component_viewer.show_details=Show Measures | |||
component_viewer.show_all_measures=Show all measures | |||
component_viewer.no_component=The component has been removed or never existed. | |||
source_viewer.covered=Covered by tests | |||
source_viewer.covered=Covered by the following tests | |||
source_viewer.not_covered=Not covered by tests | |||
source_viewer.conditions=conditions | |||
source_viewer.tooltip.duplicated_line=This line is duplicated. Click to see duplicated blocks. | |||
source_viewer.tooltip.duplicated_block=Duplicated block. Click for details. | |||
source_viewer.tooltip.covered=Fully covered by tests. Click for details. | |||
source_viewer.tooltip.partially-covered=Partially covered by tests. Click for details. | |||
source_viewer.tooltip.covered=Fully covered by tests. | |||
source_viewer.tooltip.partially-covered=Partially covered by tests. | |||
source_viewer.tooltip.uncovered=Not covered by tests. | |||
source_viewer.tooltip.no_information_about_tests=There is no extra information about test files. | |||
source_viewer.load_more_code=Load More Code | |||
source_viewer.loading_more_code=Loading More Code... |