diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-04-04 14:14:15 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-04-04 14:14:15 +0100 |
commit | 5197b011a97a86b1c57cff8d8de73c30914c8c76 (patch) | |
tree | 152615892e07cba594faabeb3170d7fd86c695c2 /spec/javascripts/environments | |
parent | d037a2e998b807d01585a48af90a3b3182eeebc5 (diff) | |
download | gitlab-ce-5197b011a97a86b1c57cff8d8de73c30914c8c76.tar.gz |
Fixes broken lints
Adds js unit tests
Diffstat (limited to 'spec/javascripts/environments')
-rw-r--r-- | spec/javascripts/environments/environment_actions_spec.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/javascripts/environments/environment_actions_spec.js b/spec/javascripts/environments/environment_actions_spec.js index 13840b42bd6..6348d97b0a5 100644 --- a/spec/javascripts/environments/environment_actions_spec.js +++ b/spec/javascripts/environments/environment_actions_spec.js @@ -19,6 +19,11 @@ describe('Actions Component', () => { name: 'foo', play_path: '#', }, + { + name: 'foo bar', + play_path: 'url', + playable: false, + }, ]; spy = jasmine.createSpy('spy').and.returnValue(Promise.resolve()); @@ -49,4 +54,14 @@ describe('Actions Component', () => { expect(spy).toHaveBeenCalledWith(actionsMock[0].play_path); }); + + it('should render a disabled action when it\'s not playable', () => { + expect( + component.$el.querySelector('.dropdown-menu li:last-child button').getAttribute('disabled'), + ).toEqual('disabled'); + + expect( + component.$el.querySelector('.dropdown-menu li:last-child button').classList.contains('disabled'), + ).toEqual(true); + }); }); |