diff options
author | Stan Hu <stanhu@gmail.com> | 2019-04-13 08:54:32 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-04-17 14:45:24 +0300 |
commit | fbb3fd1397c1304d424da404c226e4a4f9aa262b (patch) | |
tree | 6ee45e4a54b4d67515dd3cccd3cd104517d48853 /spec/javascripts/performance_bar | |
parent | b0c0f81d549165e69ca871f94ed0154e30a8970c (diff) |
Add backtrace to Gitaly performance bar
This adds the backtrace to a table to show exactly where the Gitaly call
was made to make it easier to understand where the call originated.
This change also collapses the details in the same row to improve the
usability when there is a backtrace.
Diffstat (limited to 'spec/javascripts/performance_bar')
-rw-r--r-- | spec/javascripts/performance_bar/components/detailed_metric_spec.js | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/spec/javascripts/performance_bar/components/detailed_metric_spec.js b/spec/javascripts/performance_bar/components/detailed_metric_spec.js index e91685e50c5..8a7aa057186 100644 --- a/spec/javascripts/performance_bar/components/detailed_metric_spec.js +++ b/spec/javascripts/performance_bar/components/detailed_metric_spec.js @@ -27,8 +27,8 @@ describe('detailedMetric', () => { describe('when the current request has details', () => { const requestDetails = [ - { duration: '100', feature: 'find_commit', request: 'abcdef' }, - { duration: '23', feature: 'rebase_in_progress', request: '' }, + { duration: '100', feature: 'find_commit', request: 'abcdef', backtrace: ['hello', 'world'] }, + { duration: '23', feature: 'rebase_in_progress', request: '', backtrace: ['world', 'hello'] }, ]; beforeEach(() => { @@ -54,9 +54,11 @@ describe('detailedMetric', () => { }); it('adds a modal with a table of the details', () => { - vm.$el.querySelectorAll('.performance-bar-modal td strong').forEach((duration, index) => { - expect(duration.innerText).toContain(requestDetails[index].duration); - }); + vm.$el + .querySelectorAll('.performance-bar-modal td:nth-child(1)') + .forEach((duration, index) => { + expect(duration.innerText).toContain(requestDetails[index].duration); + }); vm.$el .querySelectorAll('.performance-bar-modal td:nth-child(2)') @@ -65,10 +67,16 @@ describe('detailedMetric', () => { }); vm.$el - .querySelectorAll('.performance-bar-modal td:nth-child(3)') + .querySelectorAll('.performance-bar-modal td:nth-child(2)') .forEach((request, index) => { - expect(request.innerText).toEqual(requestDetails[index].request); + expect(request.innerText).toContain(requestDetails[index].request); }); + + expect(vm.$el.querySelector('.text-expander.js-toggle-button')).not.toBeNull(); + + vm.$el.querySelectorAll('.performance-bar-modal td:nth-child(2)').forEach(request => { + expect(request.innerText).toContain('world'); + }); }); it('displays the metric name', () => { |