Commit b5510ac8 authored by Simon Knox's avatar Simon Knox

make test exports consistent

parent e3405212
/* global BoardService */ /* global BoardService */
/* global mockBoardService */
import Vue from 'vue'; import Vue from 'vue';
import '~/boards/stores/boards_store'; import '~/boards/stores/boards_store';
import boardBlankState from '~/boards/components/board_blank_state'; import boardBlankState from '~/boards/components/board_blank_state';
import { mockBoardService } from './mock_data'; import './mock_data';
describe('Boards blank state', () => { describe('Boards blank state', () => {
let vm; let vm;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
/* global listObj */ /* global listObj */
/* global boardsMockInterceptor */ /* global boardsMockInterceptor */
/* global BoardService */ /* global BoardService */
/* global mockBoardService */
import Vue from 'vue'; import Vue from 'vue';
import '~/boards/models/assignee'; import '~/boards/models/assignee';
...@@ -12,7 +13,7 @@ import '~/boards/models/list'; ...@@ -12,7 +13,7 @@ import '~/boards/models/list';
import '~/boards/models/label'; import '~/boards/models/label';
import '~/boards/stores/boards_store'; import '~/boards/stores/boards_store';
import boardCard from '~/boards/components/board_card'; import boardCard from '~/boards/components/board_card';
import { mockBoardService } from './mock_data'; import './mock_data';
describe('Board card', () => { describe('Board card', () => {
let vm; let vm;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
/* global List */ /* global List */
/* global listObj */ /* global listObj */
/* global ListIssue */ /* global ListIssue */
/* global mockBoardService */
import Vue from 'vue'; import Vue from 'vue';
import _ from 'underscore'; import _ from 'underscore';
import Sortable from 'vendor/Sortable'; import Sortable from 'vendor/Sortable';
...@@ -12,7 +13,7 @@ import '~/boards/mixins/sortable_default_options'; ...@@ -12,7 +13,7 @@ import '~/boards/mixins/sortable_default_options';
import '~/boards/models/issue'; import '~/boards/models/issue';
import '~/boards/models/list'; import '~/boards/models/list';
import '~/boards/stores/boards_store'; import '~/boards/stores/boards_store';
import { mockBoardService } from './mock_data'; import './mock_data';
window.Sortable = Sortable; window.Sortable = Sortable;
......
/* global boardsMockInterceptor */ /* global boardsMockInterceptor */
/* global BoardService */ /* global BoardService */
/* global mockBoardService */
/* global List */ /* global List */
/* global listObj */ /* global listObj */
...@@ -7,7 +8,7 @@ import Vue from 'vue'; ...@@ -7,7 +8,7 @@ import Vue from 'vue';
import boardNewIssue from '~/boards/components/board_new_issue'; import boardNewIssue from '~/boards/components/board_new_issue';
import '~/boards/models/list'; import '~/boards/models/list';
import { mockBoardService } from './mock_data'; import './mock_data';
describe('Issue boards new issue form', () => { describe('Issue boards new issue form', () => {
let vm; let vm;
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
/* global listObj */ /* global listObj */
/* global listObjDuplicate */ /* global listObjDuplicate */
/* global ListIssue */ /* global ListIssue */
/* global mockBoardService */
import Vue from 'vue'; import Vue from 'vue';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import '~/lib/utils/url_utility'; import '~/lib/utils/url_utility';
import '~/boards/models/issue'; import '~/boards/models/issue';
import '~/boards/models/label'; import '~/boards/models/label';
...@@ -15,7 +15,7 @@ import '~/boards/models/list'; ...@@ -15,7 +15,7 @@ import '~/boards/models/list';
import '~/boards/models/assignee'; import '~/boards/models/assignee';
import '~/boards/services/board_service'; import '~/boards/services/board_service';
import '~/boards/stores/boards_store'; import '~/boards/stores/boards_store';
import { mockBoardService } from './mock_data'; import './mock_data';
describe('Store', () => { describe('Store', () => {
beforeEach(() => { beforeEach(() => {
......
/* global mockBoardService */
import Vue from 'vue'; import Vue from 'vue';
import '~/boards/services/board_service'; import '~/boards/services/board_service';
import '~/boards/components/board'; import '~/boards/components/board';
import '~/boards/models/list'; import '~/boards/models/list';
import { mockBoardService } from '../mock_data'; import '../mock_data';
describe('Board component', () => { describe('Board component', () => {
let vm; let vm;
......
/* eslint-disable comma-dangle */ /* eslint-disable comma-dangle */
/* global BoardService */ /* global BoardService */
/* global ListIssue */ /* global ListIssue */
/* global mockBoardService */
import Vue from 'vue'; import Vue from 'vue';
import '~/lib/utils/url_utility'; import '~/lib/utils/url_utility';
...@@ -10,7 +11,7 @@ import '~/boards/models/list'; ...@@ -10,7 +11,7 @@ import '~/boards/models/list';
import '~/boards/models/assignee'; import '~/boards/models/assignee';
import '~/boards/services/board_service'; import '~/boards/services/board_service';
import '~/boards/stores/boards_store'; import '~/boards/stores/boards_store';
import { mockBoardService } from './mock_data'; import './mock_data';
describe('Issue model', () => { describe('Issue model', () => {
let issue; let issue;
......
/* eslint-disable comma-dangle */ /* eslint-disable comma-dangle */
/* global boardsMockInterceptor */ /* global boardsMockInterceptor */
/* global BoardService */ /* global BoardService */
/* global mockBoardService */
/* global List */ /* global List */
/* global ListIssue */ /* global ListIssue */
/* global listObj */ /* global listObj */
...@@ -15,7 +16,7 @@ import '~/boards/models/list'; ...@@ -15,7 +16,7 @@ import '~/boards/models/list';
import '~/boards/models/assignee'; import '~/boards/models/assignee';
import '~/boards/services/board_service'; import '~/boards/services/board_service';
import '~/boards/stores/boards_store'; import '~/boards/stores/boards_store';
import { mockBoardService } from './mock_data'; import './mock_data';
describe('List model', () => { describe('List model', () => {
let list; let list;
......
/* global boardsMockInterceptor */ /* global boardsMockInterceptor */
/* global boardObj */ /* global boardObj */
/* global BoardService */ /* global BoardService */
/* global mockBoardService */
import Vue from 'vue'; import Vue from 'vue';
import milestoneSelect from '~/boards/components/milestone_select'; import milestoneSelect from '~/boards/components/milestone_select';
import '~/boards/services/board_service'; import '~/boards/services/board_service';
import '~/boards/stores/boards_store'; import '~/boards/stores/boards_store';
import { mockBoardService } from './mock_data'; import './mock_data';
describe('Milestone select component', () => { describe('Milestone select component', () => {
let selectMilestoneSpy; let selectMilestoneSpy;
......
...@@ -68,14 +68,7 @@ const boardsMockInterceptor = (request, next) => { ...@@ -68,14 +68,7 @@ const boardsMockInterceptor = (request, next) => {
})); }));
}; };
window.boardObj = boardObj; const mockBoardService = (opts = {}) => {
window.listObj = listObj;
window.listObjDuplicate = listObjDuplicate;
window.BoardsMockData = BoardsMockData;
window.boardsMockInterceptor = boardsMockInterceptor;
// eslint-disable-next-line import/prefer-default-export
export function mockBoardService(opts = {}) {
const boardsEndpoint = opts.boardsEndpoint || '/test/issue-boards/board'; const boardsEndpoint = opts.boardsEndpoint || '/test/issue-boards/board';
const listsEndpoint = opts.listsEndpoint || '/test/boards/1'; const listsEndpoint = opts.listsEndpoint || '/test/boards/1';
const bulkUpdatePath = opts.bulkUpdatePath || ''; const bulkUpdatePath = opts.bulkUpdatePath || '';
...@@ -87,4 +80,11 @@ export function mockBoardService(opts = {}) { ...@@ -87,4 +80,11 @@ export function mockBoardService(opts = {}) {
bulkUpdatePath, bulkUpdatePath,
boardId, boardId,
}); });
} };
window.boardObj = boardObj;
window.listObj = listObj;
window.listObjDuplicate = listObjDuplicate;
window.BoardsMockData = BoardsMockData;
window.boardsMockInterceptor = boardsMockInterceptor;
window.mockBoardService = mockBoardService;
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