<div class="source-viewer-measures-section source-viewer-measures-section-big">
  <div class="source-viewer-measures-card source-viewer-measures-card-fixed-height js-test-list">
    <div class="measures">
      <table class="source-viewer-tests-list">
        <tr>
          <td class="source-viewer-test-status note" colspan="3">
            {{t 'component_viewer.measure_section.unit_tests'}}<br>
            {{t 'component_viewer.tests.ordered_by'}}
            <a class="js-sort-tests-by-duration {{#eq testSorting 'duration'}}active-link{{/eq}}">
              {{t 'component_viewer.tests.duration'}}</a>
            /
            <a class="js-sort-tests-by-name {{#eq testSorting 'name'}}active-link{{/eq}}">
              {{t 'component_viewer.tests.test_name'}}</a>
            /
            <a class="js-sort-tests-by-status {{#eq testSorting 'status'}}active-link{{/eq}}">
              {{t 'component_viewer.tests.status'}}</a>
          </td>
          <td class="source-viewer-test-covered-lines note">{{t 'component_viewer.covered_lines'}}</td>
        </tr>
        {{#each tests}}
          <tr>
            {{#eq status 'SKIPPED'}}
              <td class="source-viewer-test-status note">{{testStatusIcon status}}</td>
              <td class="source-viewer-test-duration note"></td>
              <td class="source-viewer-test-name">{{name}}</td>
              <td class="source-viewer-test-covered-lines note"></td>
            {{else}}
              {{#ifTestData this}}
                <td class="source-viewer-test-status note">{{testStatusIcon status}}</td>
                <td class="source-viewer-test-duration note">{{durationInMs}}ms</td>
                <td class="source-viewer-test-name"><a class="js-show-test" data-id="{{testUuid}}">{{name}}</a></td>
                <td class="source-viewer-test-covered-lines note">{{coveredLines}}</td>
              {{else}}
                <td class="source-viewer-test-status note">{{testStatusIcon status}}</td>
                <td class="source-viewer-test-duration note">{{durationInMs}}ms</td>
                <td class="source-viewer-test-name">{{name}}</td>
              {{/ifTestData}}
            {{/eq}}
          </tr>
        {{/each}}
      </table>
    </div>
  </div>
</div>

{{#if selectedTest}}
  <div class="source-viewer-measures-section source-viewer-measures-section-big js-selected-test">
    <div class="source-viewer-measures-card source-viewer-measures-card-fixed-height">
      {{#notEq selectedTest.status 'ERROR'}}
        {{#notEq selectedTest.status 'FAILURE'}}
          <div class="bubble-popup-title">{{t 'component_viewer.transition.covers'}}</div>
          {{#each coveredFiles}}
            <div class="bubble-popup-section">
              <a target="_blank" href="{{dashboardUrl key}}" title="{{longName}}">{{longName}}</a>
              <span class="note">{{tp 'component_viewer.x_lines_are_covered' coveredLines}}</span>
            </div>
          {{else}}
            {{t 'none'}}
          {{/each}}
        {{/notEq}}
      {{/notEq}}

      {{#notEq selectedTest.status 'OK'}}
        {{log selectedTest}}
        <div class="bubble-popup-title">{{t 'component_viewer.details'}}</div>
        {{#if selectedTest.message}}
          <pre>{{selectedTest.message}}</pre>
        {{/if}}
        <pre>{{selectedTest.stacktrace}}</pre>
      {{/notEq}}
    </div>
  </div>
{{/if}}
