debian-mirror-gitlab/spec/frontend/registry/explorer/stubs.js

41 lines
1.1 KiB
JavaScript
Raw Normal View History

2021-02-22 17:27:13 +05:30
import {
GlModal as RealGlModal,
GlEmptyState as RealGlEmptyState,
GlSkeletonLoader as RealGlSkeletonLoader,
} from '@gitlab/ui';
import { RouterLinkStub } from '@vue/test-utils';
import { stubComponent } from 'helpers/stub_component';
2020-06-23 00:09:42 +05:30
import RealDeleteModal from '~/registry/explorer/components/details_page/delete_modal.vue';
2020-11-24 15:15:51 +05:30
import RealListItem from '~/vue_shared/components/registry/list_item.vue';
2020-06-23 00:09:42 +05:30
2021-02-22 17:27:13 +05:30
export const GlModal = stubComponent(RealGlModal, {
2020-03-13 15:44:24 +05:30
template: '<div><slot name="modal-title"></slot><slot></slot><slot name="modal-ok"></slot></div>',
methods: {
show: jest.fn(),
},
2021-02-22 17:27:13 +05:30
});
2020-03-13 15:44:24 +05:30
2021-02-22 17:27:13 +05:30
export const GlEmptyState = stubComponent(RealGlEmptyState, {
2020-03-13 15:44:24 +05:30
template: '<div><slot name="description"></slot></div>',
2021-02-22 17:27:13 +05:30
});
2020-05-24 23:13:21 +05:30
2021-02-22 17:27:13 +05:30
export const RouterLink = RouterLinkStub;
2020-06-23 00:09:42 +05:30
2021-02-22 17:27:13 +05:30
export const DeleteModal = stubComponent(RealDeleteModal, {
2020-06-23 00:09:42 +05:30
methods: {
show: jest.fn(),
},
2021-02-22 17:27:13 +05:30
});
2020-06-23 00:09:42 +05:30
2021-02-22 17:27:13 +05:30
export const GlSkeletonLoader = stubComponent(RealGlSkeletonLoader);
2020-07-28 23:09:34 +05:30
export const ListItem = {
...RealListItem,
data() {
return {
detailsSlots: [],
isDetailsShown: true,
};
},
};