gitlab-org--gitlab-foss/spec/javascripts/boards/mock_data.js.es6

57 lines
982 B
JavaScript
Raw Normal View History

2016-08-10 08:54:04 -04:00
const listObj = {
id: 1,
position: 0,
title: 'Test',
list_type: 'label',
label: {
id: 1,
title: 'Testing',
color: 'red',
description: 'testing;'
}
};
const listObjDuplicate = {
id: 2,
position: 1,
title: 'Test',
list_type: 'label',
label: {
id: 2,
title: 'Testing',
color: 'red',
description: 'testing;'
}
};
const BoardsMockData = {
'GET': {
'/test/issue-boards/board/lists{/id}/issues': {
issues: [{
title: 'Testing',
iid: 1,
confidential: false,
labels: []
}],
size: 1
}
2016-08-10 08:54:04 -04:00
},
'POST': {
2016-08-16 13:15:16 -04:00
'/test/issue-boards/board/lists{/id}': listObj
2016-08-10 08:54:04 -04:00
},
'PUT': {
2016-08-16 13:15:16 -04:00
'/test/issue-boards/board/lists{/id}': {}
2016-08-10 08:54:04 -04:00
},
'DELETE': {
2016-08-16 13:15:16 -04:00
'/test/issue-boards/board/lists{/id}': {}
2016-08-10 08:54:04 -04:00
}
};
Vue.http.interceptors.push((request, next) => {
const body = BoardsMockData[request.method][request.url];
next(request.respondWith(JSON.stringify(body), {
status: 200
}));
});