Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/issues/user_creates_issue_spec.rb')
-rw-r--r--spec/features/issues/user_creates_issue_spec.rb48
1 files changed, 48 insertions, 0 deletions
diff --git a/spec/features/issues/user_creates_issue_spec.rb b/spec/features/issues/user_creates_issue_spec.rb
index a2c868d0256..668b4265948 100644
--- a/spec/features/issues/user_creates_issue_spec.rb
+++ b/spec/features/issues/user_creates_issue_spec.rb
@@ -61,6 +61,10 @@ RSpec.describe "User creates issue" do
.and have_content(project.name)
expect(page).to have_selector('strong', text: 'Description')
end
+
+ it 'does not render the issue type dropdown' do
+ expect(page).not_to have_selector('.s-issuable-type-filter-dropdown-wrap')
+ end
end
context "when signed in as developer", :js do
@@ -188,6 +192,50 @@ RSpec.describe "User creates issue" do
end
end
+ context 'form create handles issue creation by default' do
+ let(:project) { create(:project) }
+
+ before do
+ visit new_project_issue_path(project)
+ end
+
+ it 'pre-fills the issue type dropdown with issue type' do
+ expect(find('.js-issuable-type-filter-dropdown-wrap .dropdown-toggle-text')).to have_content('Issue')
+ end
+
+ it 'does not hide the milestone select' do
+ expect(page).to have_selector('.qa-issuable-milestone-dropdown')
+ end
+ end
+
+ context 'form create handles incident creation' do
+ let(:project) { create(:project) }
+
+ before do
+ visit new_project_issue_path(project, { issuable_template: 'incident', issue: { issue_type: 'incident' } })
+ end
+
+ it 'pre-fills the issue type dropdown with incident type' do
+ expect(find('.js-issuable-type-filter-dropdown-wrap .dropdown-toggle-text')).to have_content('Incident')
+ end
+
+ it 'hides the epic select' do
+ expect(page).not_to have_selector('.epic-dropdown-container')
+ end
+
+ it 'hides the milestone select' do
+ expect(page).not_to have_selector('.qa-issuable-milestone-dropdown')
+ end
+
+ it 'hides the weight input' do
+ expect(page).not_to have_selector('.qa-issuable-weight-input')
+ end
+
+ it 'shows the incident help text' do
+ expect(page).to have_text('A modified issue to guide the resolution of incidents.')
+ end
+ end
+
context 'suggestions', :js do
it 'displays list of related issues' do
issue = create(:issue, project: project)