Commit 325fd300 authored by Fatih Acet's avatar Fatih Acet

Move spec files and mock data. Fix path references

Also some Prettier changes. Not sure why prettier-all-save
didn’t fix them in the previous commit.
parent 07f7581c
...@@ -89,8 +89,8 @@ export default { ...@@ -89,8 +89,8 @@ export default {
:milestone="milestone" :milestone="milestone"
class="d-flex align-items-center item-milestone" class="d-flex align-items-center item-milestone"
/> />
<slot name="dueDate"/> <slot name="dueDate"></slot>
<slot name="weight"/> <slot name="weight"></slot>
</div> </div>
<issue-assignees <issue-assignees
v-if="assignees.length" v-if="assignees.length"
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
aria-label="Remove" aria-label="Remove"
@click="onRemoveRequest" @click="onRemoveRequest"
> >
<icon :size="16" class="btn-item-remove-icon" name="close"/> <icon :size="16" class="btn-item-remove-icon" name="close" />
</button> </button>
</div> </div>
</template> </template>
...@@ -175,7 +175,7 @@ export default { ...@@ -175,7 +175,7 @@ export default {
class="js-related-issues-header-issue-count related-issues-header-issue-count issue-count-badge mx-1" class="js-related-issues-header-issue-count related-issues-header-issue-count issue-count-badge mx-1"
> >
<span class="issue-count-badge-count"> <span class="issue-count-badge-count">
<icon :name="issuableTypeIcon" class="mr-1 text-secondary"/> <icon :name="issuableTypeIcon" class="mr-1 text-secondary" />
{{ badgeLabel }} {{ badgeLabel }}
</span> </span>
</div> </div>
...@@ -223,7 +223,11 @@ export default { ...@@ -223,7 +223,11 @@ export default {
class="related-issues-token-body" class="related-issues-token-body"
> >
<div v-if="isFetching" class="related-issues-loading-icon qa-related-issues-loading-icon"> <div v-if="isFetching" class="related-issues-loading-icon qa-related-issues-loading-icon">
<gl-loading-icon ref="loadingIcon" label="Fetching related issues" class="prepend-top-5"/> <gl-loading-icon
ref="loadingIcon"
label="Fetching related issues"
class="prepend-top-5"
/>
</div> </div>
<ul ref="list" :class="{ 'content-list': !canReorder }" class="related-items-list"> <ul ref="list" :class="{ 'content-list': !canReorder }" class="related-items-list">
<li <li
...@@ -258,15 +262,15 @@ export default { ...@@ -258,15 +262,15 @@ export default {
> >
<issue-weight <issue-weight
v-if="issue.weight" v-if="issue.weight"
:weight="issue.weight"
slot="weight" slot="weight"
:weight="issue.weight"
class="item-weight d-flex align-items-center" class="item-weight d-flex align-items-center"
tag-name="span" tag-name="span"
/> />
<issue-due-date <issue-due-date
v-if="issue.due_date" v-if="issue.due_date"
:date="issue.due_date"
slot="dueDate" slot="dueDate"
:date="issue.due_date"
tooltip-placement="top" tooltip-placement="top"
css-class="item-due-date d-flex align-items-center" css-class="item-due-date d-flex align-items-center"
/> />
......
---
title: Make related issues components reusable
merge_request: 9730
author:
type: other
import Vue from 'vue'; import Vue from 'vue';
import relatedIssuesBlock from 'ee/related_issues/components/related_issues_block.vue'; import relatedIssuesBlock from 'ee/related_issues/components/related_issues_block.vue';
import {
import { issuable1, issuable2, issuable3, issuable4, issuable5 } from '../mock_data'; issuable1,
issuable2,
issuable3,
issuable4,
issuable5,
} from 'spec/vue_shared/components/issue/related_issuable_mock_data';
describe('RelatedIssuesBlock', () => { describe('RelatedIssuesBlock', () => {
let RelatedIssuesBlock; let RelatedIssuesBlock;
......
...@@ -2,8 +2,11 @@ import Vue from 'vue'; ...@@ -2,8 +2,11 @@ import Vue from 'vue';
import _ from 'underscore'; import _ from 'underscore';
import relatedIssuesRoot from 'ee/related_issues/components/related_issues_root.vue'; import relatedIssuesRoot from 'ee/related_issues/components/related_issues_root.vue';
import relatedIssuesService from 'ee/related_issues/services/related_issues_service'; import relatedIssuesService from 'ee/related_issues/services/related_issues_service';
import {
import { defaultProps, issuable1, issuable2 } from '../mock_data'; defaultProps,
issuable1,
issuable2,
} from 'spec/vue_shared/components/issue/related_issuable_mock_data';
describe('RelatedIssuesRoot', () => { describe('RelatedIssuesRoot', () => {
let RelatedIssuesRoot; let RelatedIssuesRoot;
......
import RelatedIssuesStore from 'ee/related_issues/stores/related_issues_store'; import RelatedIssuesStore from 'ee/related_issues/stores/related_issues_store';
import { issuable1, issuable2, issuable3, issuable4, issuable5 } from '../mock_data'; import {
issuable1,
issuable2,
issuable3,
issuable4,
issuable5,
} from 'spec/vue_shared/components/issue/related_issuable_mock_data';
describe('RelatedIssuesStore', () => { describe('RelatedIssuesStore', () => {
let store; let store;
......
...@@ -17,7 +17,7 @@ module QA ...@@ -17,7 +17,7 @@ module QA
element :add_issue_button element :add_issue_button
end end
view 'ee/app/assets/javascripts/related_issues/components/issue_item.vue' do view 'app/assets/javascripts/vue_shared/components/issue/related_issuable_item.vue' do
element :remove_issue_button element :remove_issue_button
end end
......
import Vue from 'vue'; import Vue from 'vue';
import issueItem from 'ee/related_issues/components/issue_item.vue'; import issueItem from '~/vue_shared/components/issue/related_issuable_item.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper'; import mountComponent from 'spec/helpers/vue_mount_component_helper';
import { defaultMilestone, defaultAssignees } from '../mock_data'; import { defaultMilestone, defaultAssignees } from './related_issuable_mock_data';
describe('issueItem', () => { describe('issueItem', () => {
let vm; let vm;
......
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