summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/boards
diff options
context:
space:
mode:
authorEduardo Mejía <eduar.mreyes@gmail.com>2019-07-19 01:44:05 +0000
committerClement Ho <408677-ClemMakesApps@users.noreply.gitlab.com>2019-07-19 01:44:05 +0000
commit317c787ea8cef306e266d8c46e77bcc029ae45f8 (patch)
treea3fbf5354d516d381365e6caefd23187d1e05a18 /app/assets/javascripts/boards
parent9578b7e9926db5900b5be07f5699aac04e47c0c6 (diff)
downloadgitlab-ce-317c787ea8cef306e266d8c46e77bcc029ae45f8.tar.gz
add stub to the boardsStore to spy on it and be able to use toHaveBeenCalledWith for the pre-defined labels test
Diffstat (limited to 'app/assets/javascripts/boards')
-rw-r--r--app/assets/javascripts/boards/components/board_blank_state.vue11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/assets/javascripts/boards/components/board_blank_state.vue b/app/assets/javascripts/boards/components/board_blank_state.vue
index d8b0b60c183..9f26337d153 100644
--- a/app/assets/javascripts/boards/components/board_blank_state.vue
+++ b/app/assets/javascripts/boards/components/board_blank_state.vue
@@ -1,6 +1,6 @@
<script>
import { __ } from '~/locale';
-/* global ListLabel */
+import ListLabel from '~/boards/models/label';
import Cookies from 'js-cookie';
import boardsStore from '../stores/boards_store';
@@ -30,13 +30,17 @@ export default {
});
// Save the labels
- gl.boardService
+ boardsStore
.generateDefaultLists()
.then(res => res.data)
.then(data => {
data.forEach(listObj => {
const list = boardsStore.findList('title', listObj.title);
+ if (!list) {
+ return;
+ }
+
list.id = listObj.id;
list.label.id = listObj.label.id;
list.getIssues().catch(() => {
@@ -69,8 +73,7 @@ export default {
<span
:style="{ backgroundColor: label.color }"
class="label-color position-relative d-inline-block rounded"
- >
- </span>
+ ></span>
{{ label.title }}
</li>
</ul>