debian-mirror-gitlab/spec/javascripts/boards/mock_data.js.es6

57 lines
990 B
JavaScript
Raw Normal View History

2016-09-13 17:45:13 +05:30
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': {
2016-11-03 12:29:30 +05:30
'/test/issue-boards/board/1/lists{/id}/issues': {
2016-09-29 09:46:39 +05:30
issues: [{
title: 'Testing',
iid: 1,
confidential: false,
labels: []
}],
size: 1
}
2016-09-13 17:45:13 +05:30
},
'POST': {
2016-11-03 12:29:30 +05:30
'/test/issue-boards/board/1/lists{/id}': listObj
2016-09-13 17:45:13 +05:30
},
'PUT': {
2016-11-03 12:29:30 +05:30
'/test/issue-boards/board/1/lists{/id}': {}
2016-09-13 17:45:13 +05:30
},
'DELETE': {
2016-11-03 12:29:30 +05:30
'/test/issue-boards/board/1/lists{/id}': {}
2016-09-13 17:45:13 +05:30
}
};
Vue.http.interceptors.push((request, next) => {
const body = BoardsMockData[request.method][request.url];
next(request.respondWith(JSON.stringify(body), {
status: 200
}));
});