diff options
author | Simon Knox <simon@gitlab.com> | 2018-06-29 23:27:15 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-06-29 23:27:15 +0300 |
commit | e64d4fd36f0d0b3c5be6e5f666af72ebd58a4293 (patch) | |
tree | 909505c4ce1ace3b775d8ffa973ec66febe928e6 /spec/javascripts/pipelines | |
parent | 906e07fbfa9303772ecd3b2c7e83de662d670772 (diff) |
Resolve "Tooltips scroll along the list within Pipeline jobs dropdown on MR widget"
Diffstat (limited to 'spec/javascripts/pipelines')
-rw-r--r-- | spec/javascripts/pipelines/graph/job_component_spec.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/javascripts/pipelines/graph/job_component_spec.js b/spec/javascripts/pipelines/graph/job_component_spec.js index 073dae56c25..9c55a19ebc7 100644 --- a/spec/javascripts/pipelines/graph/job_component_spec.js +++ b/spec/javascripts/pipelines/graph/job_component_spec.js @@ -135,4 +135,34 @@ describe('pipeline graph job component', () => { expect(component.$el.querySelector('.js-job-component-tooltip').getAttribute('data-original-title')).toEqual('test - success'); }); }); + + describe('tooltip placement', () => { + const tooltipBoundary = 'a[data-boundary="viewport"]'; + + it('does not set tooltip boundary by default', () => { + component = mountComponent(JobComponent, { + job: mockJob, + }); + + expect(component.$el.querySelector(tooltipBoundary)).toBeNull(); + }); + + it('sets tooltip boundary to viewport for small dropdowns', () => { + component = mountComponent(JobComponent, { + job: mockJob, + dropdownLength: 1, + }); + + expect(component.$el.querySelector(tooltipBoundary)).not.toBeNull(); + }); + + it('does not set tooltip boundary for large lists', () => { + component = mountComponent(JobComponent, { + job: mockJob, + dropdownLength: 7, + }); + + expect(component.$el.querySelector(tooltipBoundary)).toBeNull(); + }); + }); }); |