koel/resources/assets/js/__tests__/stubs.ts

28 lines
732 B
TypeScript
Raw Normal View History

import type { Ref } from 'vue'
import { ref } from 'vue'
import { noop } from '@/utils'
import type MessageToaster from '@/components/ui/message-toaster/MessageToaster.vue'
import type DialogBox from '@/components/ui/DialogBox.vue'
import type Overlay from '@/components/ui/Overlay.vue'
2022-12-02 16:17:37 +00:00
export const MessageToasterStub = ref({
info: noop,
success: noop,
warning: noop,
error: noop,
2022-12-02 16:17:37 +00:00
}) as unknown as Ref<InstanceType<typeof MessageToaster>>
2022-12-02 16:17:37 +00:00
export const DialogBoxStub = ref({
info: noop,
success: noop,
warning: noop,
error: noop,
confirm: noop,
2022-12-02 16:17:37 +00:00
}) as unknown as Ref<InstanceType<typeof DialogBox>>
2022-12-02 16:17:37 +00:00
export const OverlayStub = ref({
show: noop,
hide: noop,
2022-12-02 16:17:37 +00:00
}) as unknown as Ref<InstanceType<typeof Overlay>>