debian-mirror-gitlab/spec/frontend/vue_mr_widget/test_extension.js

40 lines
1 KiB
JavaScript
Raw Normal View History

2021-11-18 22:05:49 +05:30
import { EXTENSION_ICONS } from '~/vue_merge_request_widget/constants';
export default {
name: 'WidgetTestExtension',
props: ['targetProjectFullPath'],
2021-12-11 22:18:48 +05:30
expandEvent: 'test_expand_event',
2021-11-18 22:05:49 +05:30
computed: {
summary({ count, targetProjectFullPath }) {
return `Test extension summary count: ${count} & ${targetProjectFullPath}`;
},
statusIcon({ count }) {
return count > 0 ? EXTENSION_ICONS.warning : EXTENSION_ICONS.success;
},
},
methods: {
fetchCollapsedData({ targetProjectFullPath }) {
return Promise.resolve({ targetProjectFullPath, count: 1 });
},
fetchFullData() {
return Promise.resolve([
{
id: 1,
text: 'Hello world',
icon: {
name: EXTENSION_ICONS.failed,
},
badge: {
text: 'Closed',
},
link: {
href: 'https://gitlab.com',
text: 'GitLab.com',
},
2021-12-11 22:18:48 +05:30
actions: [{ text: 'Full report', href: 'https://gitlab.com', target: '_blank' }],
2021-11-18 22:05:49 +05:30
},
]);
},
},
};