Commit d037a2e9 authored by Filipa Lacerda's avatar Filipa Lacerda

Fix typo

Adds tests
parent 3db1b959
......@@ -69,7 +69,7 @@ export default {
type="button"
@click="onClickAction(action.play_path)"
class="js-manual-action-link no-btn btn"
:class="{ 'disabled': !actions.playable }"
:class="{ 'disabled': !action.playable }"
:disabled="!action.playable">
${playIconSvg}
<span>
......
......@@ -49,7 +49,7 @@ export default {
data-toggle="dropdown"
data-placement="top"
aria-label="Manual job"
:disabled="isDisabled">
:disabled="isLoading">
${playIconSvg}
<i class="fa fa-caret-down" aria-hidden="true"></i>
<i v-if="isLoading" class="fa fa-spinner fa-spin" aria-hidden="true"></i>
......@@ -60,9 +60,9 @@ export default {
<button
type="button"
class="js-pipeline-action-link no-btn btn"
:class="{ 'disabled': !actions.playable }"
:class="{ 'disabled': !action.playable }"
@click="onClickAction(action.path)"
:disabled="!actions.playable">
:disabled="!action.playable">
${playIconSvg}
<span>{{action.name}}</span>
</button>
......
......@@ -192,5 +192,10 @@ FactoryGirl.define do
trait :no_options do
options { {} }
end
trait :non_playable do
status 'created'
self.when 'manual'
end
end
end
......@@ -32,5 +32,10 @@ FactoryGirl.define do
environment.update_attribute(:deployments, [deployment])
end
end
trait :non_playable do
status 'created'
self.when 'manual'
end
end
end
......@@ -115,6 +115,21 @@ feature 'Environments page', :feature, :js do
.not_to change { Ci::Pipeline.count }
end
scenario 'when action is non playable', js: true do
given(:action) do
create(:ci_build, :manual, :non_playable,
pipeline: pipeline,
name: 'close_app')
end
it 'has disabled button to the manual action' do
find('.js-dropdown-play-icon-container').click
expect(page).to have_button('close_app', disabled: true)
end
end
scenario 'does show build name and id' do
expect(page).to have_link("#{build.name} ##{build.id}")
end
......
......@@ -197,6 +197,24 @@ describe 'Pipelines', :feature, :js do
end
end
context 'with non playable manual action' do
let!(:manual) do
create(:ci_build, :manual, :non_playable,
pipeline: pipeline,
name: 'manual build',
stage: 'test',
commands: 'test')
end
before { visit_project_pipelines }
it 'has disabled button to the manual action' do
find('.js-pipeline-dropdown-manual-actions').click
expect(page).to have_button('manual build', disabled: true)
end
end
context 'for generic statuses' do
context 'when running' do
let!(:running) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment