Commit f2f33145 authored by Clement Ho's avatar Clement Ho

Merge branch 'Update-boards_selector.vue-to-use-boardsStore' into 'master'

Remove all references of BoardService in boards_selector.vue

See merge request gitlab-org/gitlab!20147
parents 2461ea0f 22637016
......@@ -168,7 +168,7 @@ export default {
}
const recentBoardsPromise = new Promise((resolve, reject) =>
gl.boardService
boardsStore
.recentBoards()
.then(resolve)
.catch(err => {
......@@ -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(([allBoardsJson, recentBoardsJson]) => {
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 BoardService from '~/boards/services/board_service';
import BoardsSelector from '~/boards/components/boards_selector.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import { TEST_HOST } from 'spec/test_constants';
......@@ -37,7 +36,6 @@ describe('BoardsSelector', () => {
bulkUpdatePath: '',
boardId: '',
});
window.gl.boardService = new BoardService();
allBoardsResponse = Promise.resolve({
data: boards,
......@@ -46,8 +44,8 @@ describe('BoardsSelector', () => {
data: recentBoards,
});
spyOn(BoardService.prototype, 'allBoards').and.returnValue(allBoardsResponse);
spyOn(BoardService.prototype, 'recentBoards').and.returnValue(recentBoardsResponse);
spyOn(boardsStore, 'allBoards').and.returnValue(allBoardsResponse);
spyOn(boardsStore, 'recentBoards').and.returnValue(recentBoardsResponse);
const Component = Vue.extend(BoardsSelector);
vm = mountComponent(
......@@ -94,7 +92,6 @@ describe('BoardsSelector', () => {
afterEach(() => {
vm.$destroy();
window.gl.boardService = undefined;
});
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