From bb15224286661aa27570364bd222ddfe3485263b Mon Sep 17 00:00:00 2001 From: Walmyr Lima Date: Thu, 15 Aug 2019 16:38:46 +0200 Subject: [PATCH 1/3] Add testability on views --- app/assets/javascripts/boards/components/board_card.vue | 1 + app/assets/javascripts/boards/components/board_list.vue | 1 + app/assets/javascripts/boards/components/boards_selector.vue | 1 + app/views/shared/boards/_show.html.haml | 2 +- app/views/shared/boards/components/_board.html.haml | 4 ++-- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/boards/components/board_card.vue b/app/assets/javascripts/boards/components/board_card.vue index 179148b6887..faf722f61af 100644 --- a/app/assets/javascripts/boards/components/board_card.vue +++ b/app/assets/javascripts/boards/components/board_card.vue @@ -83,6 +83,7 @@ export default { }" :index="index" :data-issue-id="issue.id" + data-qa-selector="board_card" class="board-card p-3 rounded" @mousedown="mouseDown" @mousemove="mouseMove" diff --git a/app/assets/javascripts/boards/components/board_list.vue b/app/assets/javascripts/boards/components/board_list.vue index 03a8a92575e..de41698ca04 100644 --- a/app/assets/javascripts/boards/components/board_list.vue +++ b/app/assets/javascripts/boards/components/board_list.vue @@ -227,6 +227,7 @@ export default {
diff --git a/app/assets/javascripts/boards/components/boards_selector.vue b/app/assets/javascripts/boards/components/boards_selector.vue index b05de4538f2..7296426549a 100644 --- a/app/assets/javascripts/boards/components/boards_selector.vue +++ b/app/assets/javascripts/boards/components/boards_selector.vue @@ -226,6 +226,7 @@ export default {
"true", data: board_data, ":class" => "{ 'is-compact': detailIssueVisible }" } = render 'shared/issuable/search_bar', type: :boards, board: board - .boards-list.w-100.py-3.px-2.text-nowrap + .boards-list.w-100.py-3.px-2.text-nowrap{ data: { qa_selector: "boards_list" } } .boards-app-loading.w-100.text-center{ "v-if" => "loading" } = icon("spinner spin 2x") %board{ "v-cloak" => "true", diff --git a/app/views/shared/boards/components/_board.html.haml b/app/views/shared/boards/components/_board.html.haml index 6c0613605eb..5abd4ce0fb9 100644 --- a/app/views/shared/boards/components/_board.html.haml +++ b/app/views/shared/boards/components/_board.html.haml @@ -1,7 +1,7 @@ .board.d-inline-block.h-100.px-2.align-top.ws-normal{ ":class" => '{ "is-draggable": !list.preset, "is-expandable": list.isExpandable, "is-collapsed": !list.isExpanded, "board-type-assignee": list.type === "assignee" }', - ":data-id" => "list.id" } + ":data-id" => "list.id", data: { qa_selector: "board_list" } } .board-inner.d-flex.flex-column.position-relative.h-100.rounded - %header.board-header{ ":class" => '{ "has-border": list.label && list.label.color, "position-relative": list.isExpanded, "position-absolute position-top-0 position-left-0 w-100 h-100": !list.isExpanded }', ":style" => "{ borderTopColor: (list.label && list.label.color ? list.label.color : null) }" } + %header.board-header{ ":class" => '{ "has-border": list.label && list.label.color, "position-relative": list.isExpanded, "position-absolute position-top-0 position-left-0 w-100 h-100": !list.isExpanded }', ":style" => "{ borderTopColor: (list.label && list.label.color ? list.label.color : null) }", data: { qa_selector: "board_list_header" } } %h3.board-title.m-0.d-flex.js-board-handle{ ":class" => '{ "user-can-drag": (!disabled && !list.preset), "border-bottom-0": !list.isExpanded }' } .board-title-caret.no-drag{ "v-if": "list.isExpandable", From a971b7cb98439dfa1415b280dc63b113e6a699a4 Mon Sep 17 00:00:00 2001 From: Walmyr Lima Date: Mon, 19 Aug 2019 20:15:44 +0200 Subject: [PATCH 2/3] Allow issue fabrication with milestone --- qa/qa/resource/issue.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qa/qa/resource/issue.rb b/qa/qa/resource/issue.rb index 51b2af8b4ef..16ab59352f3 100644 --- a/qa/qa/resource/issue.rb +++ b/qa/qa/resource/issue.rb @@ -3,7 +3,7 @@ module QA module Resource class Issue < Base - attr_writer :description + attr_writer :description, :milestone attribute :project do Project.fabricate! do |resource| @@ -44,7 +44,9 @@ module QA { labels: labels, title: title - } + }.tap do |hash| + hash[:milestone_id] = @milestone.id if @milestone + end end end end From 126219850ef9e1016fa6c39e905745fb697aac09 Mon Sep 17 00:00:00 2001 From: Walmyr Lima Date: Tue, 20 Aug 2019 19:31:05 +0200 Subject: [PATCH 3/3] Expose id attribute on label resource --- qa/qa/resource/label.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/qa/qa/resource/label.rb b/qa/qa/resource/label.rb index 3750725c440..b5e88d8aefc 100644 --- a/qa/qa/resource/label.rb +++ b/qa/qa/resource/label.rb @@ -7,6 +7,7 @@ module QA class Label < Base attr_accessor :description, :color + attribute :id attribute :title attribute :project do