Commit 22637016 authored by Marvin Karegyeya's avatar Marvin Karegyeya Committed by Clement Ho

Remove all references of BoardService in boards_selector.vue

parent 2461ea0f
...@@ -168,7 +168,7 @@ export default { ...@@ -168,7 +168,7 @@ export default {
} }
const recentBoardsPromise = new Promise((resolve, reject) => const recentBoardsPromise = new Promise((resolve, reject) =>
gl.boardService boardsStore
.recentBoards() .recentBoards()
.then(resolve) .then(resolve)
.catch(err => { .catch(err => {
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
}), }),
); );
Promise.all([gl.boardService.allBoards(), recentBoardsPromise]) Promise.all([boardsStore.allBoards(), recentBoardsPromise])
.then(([allBoards, recentBoards]) => [allBoards.data, recentBoards.data]) .then(([allBoards, recentBoards]) => [allBoards.data, recentBoards.data])
.then(([allBoardsJson, recentBoardsJson]) => { .then(([allBoardsJson, recentBoardsJson]) => {
this.loading = false; this.loading = false;
......
---
title: remove all references of BoardService in boards_selector.vue
merge_request: 20147
author: nuwe1
type: other
import Vue from 'vue'; import Vue from 'vue';
import BoardService from '~/boards/services/board_service';
import BoardsSelector from '~/boards/components/boards_selector.vue'; import BoardsSelector from '~/boards/components/boards_selector.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper'; import mountComponent from 'spec/helpers/vue_mount_component_helper';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
...@@ -37,7 +36,6 @@ describe('BoardsSelector', () => { ...@@ -37,7 +36,6 @@ describe('BoardsSelector', () => {
bulkUpdatePath: '', bulkUpdatePath: '',
boardId: '', boardId: '',
}); });
window.gl.boardService = new BoardService();
allBoardsResponse = Promise.resolve({ allBoardsResponse = Promise.resolve({
data: boards, data: boards,
...@@ -46,8 +44,8 @@ describe('BoardsSelector', () => { ...@@ -46,8 +44,8 @@ describe('BoardsSelector', () => {
data: recentBoards, data: recentBoards,
}); });
spyOn(BoardService.prototype, 'allBoards').and.returnValue(allBoardsResponse); spyOn(boardsStore, 'allBoards').and.returnValue(allBoardsResponse);
spyOn(BoardService.prototype, 'recentBoards').and.returnValue(recentBoardsResponse); spyOn(boardsStore, 'recentBoards').and.returnValue(recentBoardsResponse);
const Component = Vue.extend(BoardsSelector); const Component = Vue.extend(BoardsSelector);
vm = mountComponent( vm = mountComponent(
...@@ -94,7 +92,6 @@ describe('BoardsSelector', () => { ...@@ -94,7 +92,6 @@ describe('BoardsSelector', () => {
afterEach(() => { afterEach(() => {
vm.$destroy(); vm.$destroy();
window.gl.boardService = undefined;
}); });
describe('filtering', () => { describe('filtering', () => {
......
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