From 5197b011a97a86b1c57cff8d8de73c30914c8c76 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Tue, 4 Apr 2017 14:14:15 +0100 Subject: Fixes broken lints Adds js unit tests --- .../environments/components/environment_actions.js | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'app/assets/javascripts/environments') diff --git a/app/assets/javascripts/environments/components/environment_actions.js b/app/assets/javascripts/environments/components/environment_actions.js index b88b1c6556e..4bb7920bb5e 100644 --- a/app/assets/javascripts/environments/components/environment_actions.js +++ b/app/assets/javascripts/environments/components/environment_actions.js @@ -45,6 +45,14 @@ export default { new Flash('An error occured while making the request.'); }); }, + + isActionDisabled(action) { + if (action.playable === undefined) { + return false; + } + + return !action.playable; + }, }, template: ` @@ -59,18 +67,23 @@ export default { :disabled="isLoading"> - - +