diff options
author | Phil Hughes <me@iamphill.com> | 2017-02-23 15:49:12 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-02-23 15:49:12 +0000 |
commit | a9bcb5b8f952fd6d8eebdd17fcc1bd904bb3c819 (patch) | |
tree | dde6c657429139fe56983e69ccfe924e12f12bf0 | |
parent | 7512af29fc5fd94da2ac74a3188eb76b9a366c2a (diff) | |
download | gitlab-ce-boards-card-template-to-js.tar.gz |
Fixed eslint errorsboards-card-template-to-js
-rw-r--r-- | app/assets/javascripts/boards/components/board_card.js | 16 | ||||
-rw-r--r-- | spec/javascripts/boards/board_card_spec.js | 10 |
2 files changed, 15 insertions, 11 deletions
diff --git a/app/assets/javascripts/boards/components/board_card.js b/app/assets/javascripts/boards/components/board_card.js index 39fa183425a..52f61d84517 100644 --- a/app/assets/javascripts/boards/components/board_card.js +++ b/app/assets/javascripts/boards/components/board_card.js @@ -31,25 +31,25 @@ module.exports = { index: Number, rootPath: String, }, - data () { + data() { return { showDetail: false, - detailIssue: Store.detail + detailIssue: Store.detail, }; }, computed: { - issueDetailVisible () { + issueDetailVisible() { return this.detailIssue.issue && this.detailIssue.issue.id === this.issue.id; - } + }, }, methods: { - mouseDown () { + mouseDown() { this.showDetail = true; }, mouseMove() { this.showDetail = false; }, - showIssue (e) { + showIssue(e) { const targetTagName = e.target.tagName.toLowerCase(); if (targetTagName === 'a' || targetTagName === 'button') return; @@ -64,6 +64,6 @@ module.exports = { Store.detail.list = this.list; } } - } - } + }, + }, }; diff --git a/spec/javascripts/boards/board_card_spec.js b/spec/javascripts/boards/board_card_spec.js index 5c1ea930523..192916fbc6a 100644 --- a/spec/javascripts/boards/board_card_spec.js +++ b/spec/javascripts/boards/board_card_spec.js @@ -1,6 +1,9 @@ /* global Vue */ /* global List */ +/* global ListLabel */ /* global listObj */ +/* global boardsMockInterceptor */ +/* global BoardService */ require('~/boards/models/list'); require('~/boards/models/label'); @@ -40,7 +43,7 @@ describe('Issue card', () => { index: 0, rootPath: '/', }, - }).$mount();; + }).$mount(); done(); }, 0); }); @@ -88,7 +91,8 @@ describe('Issue card', () => { describe('mouse events', () => { const triggerEvent = (eventName, el = vm.$el) => { const event = document.createEvent('MouseEvents'); - event.initMouseEvent(eventName, true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); + event.initMouseEvent(eventName, true, true, window, 1, 0, 0, 0, 0, false, false, + false, false, 0, null); el.dispatchEvent(event); }; @@ -125,7 +129,7 @@ describe('Issue card', () => { expect(gl.issueBoards.BoardsStore.detail.issue).toEqual({}); }); - it('does not set detail issue if showDetail is false', () => { + it('does not set detail issue if showDetail is false after mouseup', () => { triggerEvent('mouseup'); expect(gl.issueBoards.BoardsStore.detail.issue).toEqual({}); |