diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2016-11-29 17:40:16 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2016-11-30 12:44:42 +0000 |
commit | edc97c9dc6c3fa43778068f2067cb5911e7ee3f0 (patch) | |
tree | 0c7e271d932a18f7341d31a6ab9bd19ea02ee3eb /spec/javascripts/environments | |
parent | 43c8788e7bd4c705bc8215ea2409b21a19d090f7 (diff) | |
download | gitlab-ce-edc97c9dc6c3fa43778068f2067cb5911e7ee3f0.tar.gz |
Use created date from last_deployment
Adds test
Adds changelog entry
Diffstat (limited to 'spec/javascripts/environments')
-rw-r--r-- | spec/javascripts/environments/environment_item_spec.js.es6 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/javascripts/environments/environment_item_spec.js.es6 b/spec/javascripts/environments/environment_item_spec.js.es6 index 14e90a9dd1b..3e2fa730c8d 100644 --- a/spec/javascripts/environments/environment_item_spec.js.es6 +++ b/spec/javascripts/environments/environment_item_spec.js.es6 @@ -1,4 +1,5 @@ //= require vue +//= require timeago //= require environments/components/environment_item describe('Environment item', () => { @@ -109,6 +110,8 @@ describe('Environment item', () => { name: 'deploy', build_path: '/root/ci-folders/builds/1279', retry_path: '/root/ci-folders/builds/1279/retry', + created_at: '2016-11-29T18:11:58.430Z', + updated_at: '2016-11-29T18:11:58.430Z', }, manual_actions: [ { @@ -149,6 +152,17 @@ describe('Environment item', () => { ).toContain('#'); }); + it('should render last deployment date', () => { + const timeagoInstance = new timeago(); // eslint-disable-line + const formatedDate = timeagoInstance.format( + environment.last_deployment.deployable.created_at + ); + + expect( + component.$el.querySelector('.environment-created-date-timeago').textContent + ).toContain(formatedDate); + }); + describe('With user information', () => { it('should render user avatar with link to profile', () => { expect( |