diff options
author | Phil Hughes <me@iamphill.com> | 2017-04-21 13:30:40 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-04-21 13:30:40 +0300 |
commit | d7154552b65c767265a8182fee463fbb5252f93b (patch) | |
tree | 4f405b2bbe056319a5a4d69a98988e50cdbcef3a /spec/javascripts/monitoring | |
parent | 05dc14074b78822ff460f703eab0a2082d2adf46 (diff) |
Rather than looping data ourselves, d3 loops it
Diffstat (limited to 'spec/javascripts/monitoring')
-rw-r--r-- | spec/javascripts/monitoring/deployments_spec.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/javascripts/monitoring/deployments_spec.js b/spec/javascripts/monitoring/deployments_spec.js index 2bcec8dcc2b..5b88f6d95a3 100644 --- a/spec/javascripts/monitoring/deployments_spec.js +++ b/spec/javascripts/monitoring/deployments_spec.js @@ -110,4 +110,24 @@ describe('Metrics deployments', () => { graphElement().querySelector('.deploy-info-1-cpu_values .js-deploy-info-box.hidden'), ).not.toBeNull(); }); + + describe('refText', () => { + it('returns shortened SHA', () => { + expect( + Deployments.refText({ + tag: false, + sha: '123456789', + }), + ).toBe('123456'); + }); + + it('returns tag name', () => { + expect( + Deployments.refText({ + tag: true, + ref: 'v1.0', + }), + ).toBe('v1.0'); + }); + }); }); |