Commit 75c5c9ef authored by Paul Slaughter's avatar Paul Slaughter

Merge branch '233410-remove-js-classes-test-reports' into 'master'

Remove js-* classes in test_reports.vue

See merge request gitlab-org/gitlab!42073
parents 961005be a65cdac2
...@@ -55,13 +55,14 @@ export default { ...@@ -55,13 +55,14 @@ export default {
<template> <template>
<div v-if="isLoading"> <div v-if="isLoading">
<gl-loading-icon size="lg" class="gl-mt-3 js-loading-spinner" /> <gl-loading-icon size="lg" class="gl-mt-3" />
</div> </div>
<div <div
v-else-if="!isLoading && showTests" v-else-if="!isLoading && showTests"
ref="container" ref="container"
class="tests-detail position-relative js-tests-detail" class="tests-detail position-relative"
data-testid="tests-detail"
> >
<transition <transition
name="slide" name="slide"
...@@ -85,7 +86,7 @@ export default { ...@@ -85,7 +86,7 @@ export default {
<div v-else> <div v-else>
<div class="row gl-mt-3"> <div class="row gl-mt-3">
<div class="col-12"> <div class="col-12">
<p class="js-no-tests-to-show">{{ s__('TestReports|There are no tests to show.') }}</p> <p data-testid="no-tests-to-show">{{ s__('TestReports|There are no tests to show.') }}</p>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -378,7 +378,7 @@ RSpec.describe 'Pipeline', :js do ...@@ -378,7 +378,7 @@ RSpec.describe 'Pipeline', :js do
find('.js-tests-tab-link').click find('.js-tests-tab-link').click
expect(page).to have_content('Jobs') expect(page).to have_content('Jobs')
expect(page).to have_selector('.js-tests-detail', visible: :all) expect(page).to have_selector('[data-testid="tests-detail"]', visible: :all)
end end
end end
......
import Vuex from 'vuex'; import Vuex from 'vuex';
import { GlLoadingIcon } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import { getJSONFixture } from 'helpers/fixtures'; import { getJSONFixture } from 'helpers/fixtures';
import TestReports from '~/pipelines/components/test_reports/test_reports.vue'; import TestReports from '~/pipelines/components/test_reports/test_reports.vue';
...@@ -15,9 +16,9 @@ describe('Test reports app', () => { ...@@ -15,9 +16,9 @@ describe('Test reports app', () => {
const testReports = getJSONFixture('pipelines/test_report.json'); const testReports = getJSONFixture('pipelines/test_report.json');
const loadingSpinner = () => wrapper.find('.js-loading-spinner'); const loadingSpinner = () => wrapper.find(GlLoadingIcon);
const testsDetail = () => wrapper.find('.js-tests-detail'); const testsDetail = () => wrapper.find('[data-testid="tests-detail"]');
const noTestsToShow = () => wrapper.find('.js-no-tests-to-show'); const noTestsToShow = () => wrapper.find('[data-testid="no-tests-to-show"]');
const testSummary = () => wrapper.find(TestSummary); const testSummary = () => wrapper.find(TestSummary);
const testSummaryTable = () => wrapper.find(TestSummaryTable); const testSummaryTable = () => wrapper.find(TestSummaryTable);
...@@ -88,6 +89,10 @@ describe('Test reports app', () => { ...@@ -88,6 +89,10 @@ describe('Test reports app', () => {
expect(wrapper.vm.testReports).toBeTruthy(); expect(wrapper.vm.testReports).toBeTruthy();
expect(wrapper.vm.showTests).toBeTruthy(); expect(wrapper.vm.showTests).toBeTruthy();
}); });
it('shows tests details', () => {
expect(testsDetail().exists()).toBe(true);
});
}); });
describe('when a suite is clicked', () => { describe('when a suite is clicked', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment