serializeData: ->
- items: @collection.toJSON().map (file) ->
+ items = @collection.toJSON().map (file) ->
_.extend file, utils.splitLongName file.longName
+ sortedItems = _.sortBy items, 'name'
+ items: sortedItems
test: @options.test
'complexity,function_complexity,' +
'comment_lines,comment_lines_density,public_api,public_undocumented_api,public_documented_api_density'
- NEW_SOURCE_METRIC_LIST = 'new_accessors,classes,functions,statements,' +
- 'ncloc,lines,' +
- 'complexity,function_complexity,' +
- 'comment_lines,comment_lines_density,public_api,public_undocumented_api,public_documented_api_density'
-
COVERAGE_METRIC_LIST = 'coverage,line_coverage,lines_to_cover,covered_lines,uncovered_lines,' +
'branch_coverage,conditions_to_cover,uncovered_conditions,' +
'it_coverage,it_line_coverage,it_lines_to_cover,it_covered_lines,it_uncovered_lines,' +
DUPLICATIONS_METRIC_LIST = 'duplicated_lines_density,duplicated_blocks,duplicated_files,duplicated_lines'
- TESTS_METRIC_LIST = 'tests'
+ TESTS_METRIC_LIST = 'tests,test_success_density,test_failures,test_errors,test_execution_time'
requestTests: (key) ->
$.get API_TESTS, key: key, (data) =>
@state.set 'hasTests', true
- @component.set 'tests', data.tests
+ @component.set 'tests', _.sortBy data.tests, 'name'
open: (key) ->
<div class="component-viewer-popup-container">
-{{#eq test.status 'OK'}}
+{{#notEq test.status 'OK'}}
+ {{#if test.message}}
+ <div class="component-viewer-popup-title">{{test.message}}</div>
+ {{/if}}
+ <pre>{{test.stackTrace}}</pre>
+{{/notEq}}
+
+{{#notEq test.status 'ERROR'}}
<div class="component-viewer-popup-title">{{t 'component_viewer.transition.covers'}}</div>
{{#each items}}
{{/each}}
</div>
-{{else}}
- {{#if test.message}}
- <div class="component-viewer-popup-title">{{test.message}}</div>
- {{/if}}
- <pre>{{test.stackTrace}}</pre>
-{{/eq}}
+{{/notEq}}
<div class="component-viewer-popup-arrow"></div>
\ No newline at end of file
+{{#with component.measures}}
+ <span class="nowrap">
+ {{#any test_success_density test_failures test_errors test_execution_time}}
+ <div class="component-viewer-header-expanded-bar-section">
+ <div class="component-viewer-header-expanded-bar-section-title">
+ {{t 'component_viewer.measure_section.unit_tests'}}
+ </div>
+ <ul class="component-viewer-header-expanded-bar-section-list">
+ {{{componentViewerHeaderItem test_success_density 'test_success_density'}}}
+ {{{componentViewerHeaderItem test_failures 'test_failures'}}}
+ {{{componentViewerHeaderItem test_errors 'test_errors'}}}
+ {{{componentViewerHeaderItem test_execution_time 'test_execution_time'}}}
+ </ul>
+ </div>
+ {{/any}}
+ </span>
+{{/with}}
+
<div class="component-viewer-header-expanded-bar-section large">
<div class="component-viewer-header-expanded-bar-section-title justify">
<span class="ib">{{t 'component_viewer.measure_section.unit_tests'}}</span>
</div>
<ul class="component-viewer-header-expanded-bar-section-list">
{{#each component.tests}}
- <li><a class="item js-unit-test" data-name="{{name}}">
- <span class="label">{{testStatusIcon status}} <span class="subtitle">{{durationInMs}}ms</span>
+ <li><a class="item js-unit-test" data-name="{{name}}" title="{{name}}">
+ <span class="label">{{testStatusIcon status}}
+ <span class="duration subtitle">{{durationInMs}}ms</span>
{{name}}</span>
- {{#eq status 'OK'}}
+ {{#if coveredLines}}
<span class="number">{{coveredLines}}</span>
- {{/eq}}
+ {{/if}}
<i class="icon-chevron-right"></i>
</a></li>
{{/each}}
right: 10px;
margin-top: -7px;
}
+
+ .duration {
+ display: inline-block;
+ min-width: 40px;
+ }
}
& > li > a.item {