Commit 16799eda authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'fix-qa-364' into 'master'

Fix the Epic QA test

Closes gitlab-qa#364

See merge request gitlab-org/gitlab-ee!9194
parents 1389fd5a 089cced7
......@@ -6,7 +6,7 @@ import sortableConfig from 'ee/sortable/sortable_config';
import { GlLoadingIcon } from '@gitlab/ui';
import issueItem from './issue_item.vue';
import addIssuableForm from './add_issuable_form.vue';
import { issuableIconMap } from '../constants';
import { issuableIconMap, issuableQaClassMap } from '../constants';
export default {
name: 'RelatedIssuesBlock',
......@@ -103,6 +103,9 @@ export default {
issuableTypeIcon() {
return issuableIconMap[this.issuableType];
},
qaClass() {
return issuableQaClassMap[this.issuableType];
},
},
mounted() {
if (this.canReorder) {
......@@ -172,7 +175,8 @@ export default {
v-if="canAdmin"
ref="issueCountBadgeAddButton"
type="button"
class="js-issue-count-badge-add-button issue-count-badge-add-button btn btn-sm btn-default qa-add-issues-button"
:class="qaClass"
class="js-issue-count-badge-add-button issue-count-badge-add-button btn btn-sm btn-default"
aria-label="Add an issue"
data-placement="top"
@click="$emit('toggleAddRelatedIssuesForm', $event)"
......
......@@ -40,3 +40,13 @@ export const issuableIconMap = {
issue: 'issues',
epic: 'epic',
};
/**
* These are used to map issuableType to the correct QA class.
* Since these are never used for any display purposes, don't wrap
* them inside i18n functions.
*/
export const issuableQaClassMap = {
issue: 'qa-add-issues-button',
epic: 'qa-add-epics-button',
};
......@@ -8,7 +8,7 @@ module QA
class Show < QA::Page::Base
include QA::Page::Component::Issuable::Common
view 'ee/app/assets/javascripts/related_issues/components/related_issues_block.vue' do
view 'ee/app/assets/javascripts/related_issues/constants.js' do
element :add_issues_button
end
......
......@@ -15,32 +15,35 @@ module QA
epic = EE::Resource::Epic.fabricate! do |epic|
epic.group = issue.project.group
epic.title = "My First Epic"
epic.title = 'My First Epic'
end
expect(page).to have_content(/My First Epic/)
expect(page).to have_content('My First Epic')
# Edit Epics
EE::Page::Group::Epic::Show.act { go_to_edit_page }
EE::Page::Group::Epic::Edit.perform do |edit_page|
edit_page.set_description("My Edited Epic Description")
edit_page.set_title("My Edited Epic")
edit_page.set_description('My Edited Epic Description')
edit_page.set_title('My Edited Epic')
edit_page.save_changes
expect(edit_page).to have_content(/My Edited Epic/)
expect(edit_page).to have_content('My Edited Epic')
end
# Add/Remove Issues to/from Epics
EE::Page::Group::Epic::Show.perform do |show_page|
show_page.add_issue_to_epic(issue.web_url)
expect(show_page).to have_content('added issue')
expect(show_page).to have_content('My Edited Epic')
show_page.remove_issue_from_epic
expect(show_page).to have_content(/removed issue/)
expect(show_page).to have_content('removed issue')
end
# Comment on Epics
EE::Page::Group::Epic::Show.act { add_comment_to_epic("My Epic Comments") }
EE::Page::Group::Epic::Show.act { add_comment_to_epic('My Epic Comments') }
expect(page).to have_content(/My Epic Comments/)
expect(page).to have_content('My Epic Comments')
# Add Issue to Epic using quick actions
issue.visit!
......@@ -49,30 +52,30 @@ module QA
show_page.select_all_activities_filter
show_page.comment("/epic #{epic.web_url}")
show_page.comment("/remove_epic")
expect(show_page).to have_content(/removed from epic/)
expect(show_page).to have_content('removed from epic')
end
epic.visit!
expect(page).to have_content("added issue", count: 2)
expect(page).to have_content("removed issue", count: 2)
expect(page).to have_content('added issue', count: 2)
expect(page).to have_content('removed issue', count: 2)
# Close Epic
EE::Page::Group::Epic::Show.act { close_reopen_epic }
expect(page).to have_content(/Closed/)
expect(page).to have_content('Closed')
# Reopen Epic
EE::Page::Group::Epic::Show.act { close_reopen_epic }
expect(page).to have_content(/Open/)
expect(page).to have_content('Open')
# Delete Epics
EE::Page::Group::Epic::Show.act { go_to_edit_page }
EE::Page::Group::Epic::Edit.perform do |edit_page|
edit_page.delete_epic
expect(edit_page).to have_content(/The epic was successfully deleted/)
expect(edit_page).to have_content('The epic was successfully deleted')
end
end
end
......
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