Commit 3161047b authored by pburdette's avatar pburdette Committed by Kamil Trzciński

Change dynamic class

Move dynamic class to
job with link and update
specs.
parent 616b8ea0
...@@ -132,8 +132,9 @@ export default { ...@@ -132,8 +132,9 @@ export default {
v-gl-tooltip="{ boundary, placement: 'bottom' }" v-gl-tooltip="{ boundary, placement: 'bottom' }"
:href="status.details_path" :href="status.details_path"
:title="tooltipText" :title="tooltipText"
:class="cssClassJobName" :class="jobClasses"
class="js-pipeline-graph-job-link qa-job-link menu-item" class="js-pipeline-graph-job-link qa-job-link menu-item"
data-testid="job-with-link"
> >
<job-name-component :name="job.name" :status="job.status" /> <job-name-component :name="job.name" :status="job.status" />
</gl-link> </gl-link>
...@@ -142,7 +143,7 @@ export default { ...@@ -142,7 +143,7 @@ export default {
v-else v-else
v-gl-tooltip="{ boundary, placement: 'bottom' }" v-gl-tooltip="{ boundary, placement: 'bottom' }"
:title="tooltipText" :title="tooltipText"
:class="jobClasses" :class="cssClassJobName"
class="js-job-component-tooltip non-details-job-component" class="js-job-component-tooltip non-details-job-component"
data-testid="job-without-link" data-testid="job-without-link"
> >
......
...@@ -6,6 +6,7 @@ describe('pipeline graph job item', () => { ...@@ -6,6 +6,7 @@ describe('pipeline graph job item', () => {
let wrapper; let wrapper;
const findJobWithoutLink = () => wrapper.find('[data-testid="job-without-link"]'); const findJobWithoutLink = () => wrapper.find('[data-testid="job-without-link"]');
const findJobWithLink = () => wrapper.find('[data-testid="job-with-link"]');
const createWrapper = propsData => { const createWrapper = propsData => {
wrapper = mount(JobItem, { wrapper = mount(JobItem, {
...@@ -88,7 +89,6 @@ describe('pipeline graph job item', () => { ...@@ -88,7 +89,6 @@ describe('pipeline graph job item', () => {
}); });
it('should apply hover class and provided class name', () => { it('should apply hover class and provided class name', () => {
expect(findJobWithoutLink().classes()).toContain(triggerActiveClass);
expect(findJobWithoutLink().classes()).toContain('css-class-job-name'); expect(findJobWithoutLink().classes()).toContain('css-class-job-name');
}); });
}); });
...@@ -151,7 +151,7 @@ describe('pipeline graph job item', () => { ...@@ -151,7 +151,7 @@ describe('pipeline graph job item', () => {
job: delayedJobFixture, job: delayedJobFixture,
}); });
expect(wrapper.find('.js-pipeline-graph-job-link').attributes('title')).toEqual( expect(findJobWithLink().attributes('title')).toEqual(
`delayed job - delayed manual action (${wrapper.vm.remainingTime})`, `delayed job - delayed manual action (${wrapper.vm.remainingTime})`,
); );
}); });
...@@ -160,20 +160,20 @@ describe('pipeline graph job item', () => { ...@@ -160,20 +160,20 @@ describe('pipeline graph job item', () => {
describe('trigger job highlighting', () => { describe('trigger job highlighting', () => {
it('trigger job should stay highlighted when downstream is expanded', () => { it('trigger job should stay highlighted when downstream is expanded', () => {
createWrapper({ createWrapper({
job: mockJobWithoutDetails, job: mockJob,
pipelineExpanded: { jobName: mockJob.name, expanded: true }, pipelineExpanded: { jobName: mockJob.name, expanded: true },
}); });
expect(findJobWithoutLink().classes()).toContain(triggerActiveClass); expect(findJobWithLink().classes()).toContain(triggerActiveClass);
}); });
it('trigger job should not be highlighted when downstream is closed', () => { it('trigger job should not be highlighted when downstream is closed', () => {
createWrapper({ createWrapper({
job: mockJobWithoutDetails, job: mockJob,
pipelineExpanded: { jobName: mockJob.name, expanded: false }, pipelineExpanded: { jobName: mockJob.name, expanded: false },
}); });
expect(findJobWithoutLink().classes()).not.toContain(triggerActiveClass); expect(findJobWithLink().classes()).not.toContain(triggerActiveClass);
}); });
}); });
}); });
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