diff options
Diffstat (limited to 'spec/features/projects/environments/environment_spec.rb')
-rw-r--r-- | spec/features/projects/environments/environment_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/features/projects/environments/environment_spec.rb b/spec/features/projects/environments/environment_spec.rb index d88ff5c1aa5..bfd54b9c6da 100644 --- a/spec/features/projects/environments/environment_spec.rb +++ b/spec/features/projects/environments/environment_spec.rb @@ -132,6 +132,29 @@ RSpec.describe 'Environment' do end end + context 'with upcoming deployments' do + let(:pipeline) { create(:ci_pipeline, project: project) } + let(:build) { create(:ci_build, pipeline: pipeline) } + + let!(:runnind_deployment_1) { create(:deployment, environment: environment, deployable: build, status: :running) } + let!(:runnind_deployment_2) { create(:deployment, environment: environment, deployable: build, status: :running) } + # Success deployments must have present `finished_at`. We'll backfill in the future. + # See https://gitlab.com/gitlab-org/gitlab/-/issues/350618 for more information. + let!(:success_without_finished_at) { create(:deployment, environment: environment, deployable: build, status: :success, finished_at: nil) } + + before do + visit_environment(environment) + end + + # This ordering is unexpected and to be fixed. + # See https://gitlab.com/gitlab-org/gitlab/-/issues/350618 for more information. + it 'shows upcoming deployments in unordered way' do + displayed_ids = find_all('[data-testid="deployment-id"]').map { |e| e.text } + internal_ids = [runnind_deployment_1, runnind_deployment_2, success_without_finished_at].map { |d| "##{d.iid}" } + expect(displayed_ids).to match_array(internal_ids) + end + end + context 'with related deployable present' do let(:pipeline) { create(:ci_pipeline, project: project) } let(:build) { create(:ci_build, pipeline: pipeline) } |