diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2017-04-05 14:20:31 -0500 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-04-05 14:20:31 -0500 |
commit | 678200125118b4d1679961efd577fde474f5ea98 (patch) | |
tree | f9710ea7983ff66fc81fe7c6146d4abfdcb0b916 | |
parent | 4da041b29e3d1a449ac72a92c7ba90927b91feb5 (diff) | |
download | gitlab-ce-update-issue-board-cards-design.tar.gz |
Remove issue_card_inner_spec.jsupdate-issue-board-cards-design
-rw-r--r-- | app/assets/javascripts/boards/components/issue_card_inner.js | 10 | ||||
-rw-r--r-- | spec/javascripts/boards/issue_card_inner_spec.js | 98 |
2 files changed, 8 insertions, 100 deletions
diff --git a/app/assets/javascripts/boards/components/issue_card_inner.js b/app/assets/javascripts/boards/components/issue_card_inner.js index f436237b739..e48d3344a2b 100644 --- a/app/assets/javascripts/boards/components/issue_card_inner.js +++ b/app/assets/javascripts/boards/components/issue_card_inner.js @@ -42,6 +42,9 @@ import eventHub from '../eventhub'; assigneeUrlTitle() { return `Assigned to ${this.issue.assignee.name}`; }, + avatarUrlTitle() { + return `Avatar for ${this.issue.assignee.name}`; + }, issueId() { return `#${this.issue.id}`; }, @@ -96,7 +99,10 @@ import eventHub from '../eventhub'; class="js-no-trigger" :href="cardUrl" :title="issue.title">{{ issue.title }}</a> - <span class="card-number"> + <span + class="card-number" + v-if="issue.id" + > {{ issueId }} </span> </h4> @@ -112,7 +118,7 @@ import eventHub from '../eventhub'; :src="issue.assignee.avatar" width="20" height="20" - :alt="assigneeUrlTitle" + :alt="avatarUrlTitle" /> </a> </div> diff --git a/spec/javascripts/boards/issue_card_inner_spec.js b/spec/javascripts/boards/issue_card_inner_spec.js deleted file mode 100644 index cf2f92427ef..00000000000 --- a/spec/javascripts/boards/issue_card_inner_spec.js +++ /dev/null @@ -1,98 +0,0 @@ -/* global listObj */ -/* global ListIssue */ - -import 'vue'; -import '~/boards/components/issue_card_inner'; -import '~/boards/models/issue'; -import '~/boards/models/label'; -import '~/boards/models/list'; -import '~/boards/models/user'; -import '~/boards/stores/boards_store'; -import './mock_data'; - -const issueLinkBase = '/test'; -const rootPath = '/'; -const list = listObj; - -const issue = new ListIssue({ - title: 'Testing', - iid: 1, - confidential: false, - labels: [list.label], -}); - -const createComponent = propsData => new gl.issueBoards.IssueCardInner({ - el: document.createElement('div'), - propsData, -}); - -describe('IssueCardInner', () => { - describe('computed', () => { - let vm; - beforeEach(() => { - vm = createComponent({ - list, - issue, - issueLinkBase, - rootPath, - }); - }); - - describe('cardUrl', () => { - it('should return the url of the card', () => { - expect(vm.cardUrl).toEqual(`${issueLinkBase}/${issue.id}`); - }); - }); - - describe('assigneeUrl', () => { - it('should return url of the assignee', () => { - expect(vm.assigneeUrl).toEqual(`${rootPath}${issue.assignee.username}`); - }); - }); - - describe('assigneeUrlTitle', () => { - it('should return url title of the assignee', () => { - expect(vm.assigneeUrlTitle).toEqual(`Assigned to ${issue.assignee.name}`); - }); - }); - - describe('issueId', () => { - it('should return formatted issue id', () => { - expect(vm.issueId).toEqual(`#${issue.id}`); - }); - }); - - describe('showLabelFooter', () => { - it('should return true when showLabel is true for one label', () => { - vm = createComponent({ - list: [], - issue, - issueLinkBase, - rootPath, - }); - - expect(vm.showLabelFooter).toEqual(true); - }); - - it('should return false when there are no labels', () => { - vm = createComponent({ - list: [], - issue: new ListIssue({ - title: 'Testing', - iid: 1, - confidential: false, - labels: [], - }), - issueLinkBase, - rootPath, - }); - - expect(vm.showLabelFooter).toEqual(false); - }); - - it('should return false when showLabel is false for all labels', () => { - expect(vm.showLabelFooter).toEqual(false); - }); - }); - }); -}); |