Commit fb77b058 authored by Simon Knox's avatar Simon Knox

fix remaining karma tests

parent 6c402008
......@@ -82,7 +82,7 @@ export default {
this.showIssueForm = !this.showIssueForm;
},
onScroll() {
if ((this.scrollTop() > this.scrollHeight() - this.scrollOffset) && !this.list.loadingMore) {
if (!this.list.loadingMore && (this.scrollTop() > this.scrollHeight() - this.scrollOffset)) {
this.loadNextPage();
}
},
......@@ -163,7 +163,7 @@ export default {
this.$refs.list.removeEventListener('scroll', this.onScroll);
},
template: `
<transition-group tag="div" class="board-list-component">
<div class="board-list-component">
<div
key="loading"
class="board-list-loading text-center"
......@@ -212,6 +212,6 @@ export default {
</span>
</li>
</ul>
</transition-group>
</div>
`,
};
......@@ -33,7 +33,9 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({
const issue = this.issue;
const lists = issue.getLists();
const listLabelIds = lists.map(list => list.label.id);
const labelIds = this.issue.labels.map(label => label.id).filter(id => !listLabelIds.includes(id));
const labelIds = this.issue.labels
.map(label => label.id)
.filter(id => !listLabelIds.includes(id));
const data = {
issue: {
label_ids: labelIds,
......
......@@ -94,7 +94,8 @@ class ListIssue {
data.issue.label_ids = [''];
}
return Vue.http.patch(url.replace(':project_path', this.project.path), data);
const projectPath = this.project ? this.project.path : '';
return Vue.http.patch(url.replace(':project_path', projectPath), data);
}
}
......
......@@ -111,6 +111,7 @@ class List {
.then(resp => resp.json())
.then((data) => {
issue.id = data.id;
issue.iid = data.iid;
issue.milestone = data.milestone;
if (this.issuesSize > 1) {
......
......@@ -17,7 +17,7 @@ import '~/boards/services/board_service';
import '~/boards/stores/boards_store';
import { mockBoardService } from './mock_data';
fdescribe('Store', () => {
describe('Store', () => {
beforeEach(() => {
Vue.http.interceptors.push(boardsMockInterceptor);
gl.boardService = mockBoardService();
......@@ -210,6 +210,7 @@ fdescribe('Store', () => {
it('moves issue in list', (done) => {
const issue = new ListIssue({
title: 'Testing',
id: 2,
iid: 2,
confidential: false,
labels: [],
......
......@@ -37,6 +37,7 @@ describe('Issue card component', () => {
list = listObj;
issue = new ListIssue({
title: 'Testing',
id: 1,
iid: 1,
confidential: false,
labels: [list.label],
......
......@@ -21,6 +21,7 @@ describe('Issue model', () => {
issue = new ListIssue({
title: 'Testing',
id: 1,
iid: 1,
confidential: false,
labels: [{
......
......@@ -23,10 +23,7 @@ describe('List model', () => {
beforeEach(() => {
Vue.http.interceptors.push(boardsMockInterceptor);
gl.boardService = mockBoardService({
boardsEndpoint: '/test/issue-boards/board',
listsEndpoint: '/boards/1',
bulkUpdatePath: '/test/issue-boards/board/1/lists',
boardId: '1',
});
gl.issueBoards.BoardsStore.create();
......
......@@ -44,24 +44,13 @@ const BoardsMockData = {
assignees: [],
}],
},
'/boards/1{/id}/issues': {
issues: [{
title: 'Testing',
id: 1,
iid: 1,
confidential: false,
labels: [],
assignees: [],
}],
size: 1
},
'/test/issue-boards/milestones.json': [{
id: 1,
title: 'test',
}],
},
'POST': {
'/boards/1{/id}': listObj
'/test/boards/1{/id}': listObj
},
'PUT': {
'/test/issue-boards/board/1/lists{/id}': {}
......
......@@ -18,6 +18,7 @@ describe('Modal store', () => {
issue = new ListIssue({
title: 'Testing',
id: 1,
iid: 1,
confidential: false,
labels: [],
......@@ -25,6 +26,7 @@ describe('Modal store', () => {
});
issue2 = new ListIssue({
title: 'Testing',
id: 2,
iid: 2,
confidential: false,
labels: [],
......
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