mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-16 10:29:36 +00:00
## Summary Add tests verifying real model loading: - Upload cube.obj via file chooser button - Drag-and-drop cube.obj onto the 3D canvas - Add data-testid to LoadingOverlay for stable test selectors. Add tests verifying 3d viewer openning: - Open viewer from Load3D node via expand button, verify canvas and controls sidebar - Cancel button closes the viewer dialog ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10957-test-add-E2E-tests-for-Load3D-model-upload-and-drag-drop-and-basic-e2e-for-3d-viewer-33c6d73d3650810c8ff8ed656a5164a6) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <github-actions@github.com>
51 lines
1.2 KiB
Vue
51 lines
1.2 KiB
Vue
<template>
|
|
<Transition name="fade">
|
|
<div
|
|
v-if="loading"
|
|
class="absolute inset-0 z-50 flex items-center justify-center bg-backdrop/50"
|
|
data-testid="loading-overlay"
|
|
>
|
|
<div class="flex flex-col items-center">
|
|
<div class="grid place-items-center">
|
|
<div
|
|
:class="
|
|
cn(
|
|
'col-start-1 row-start-1 animate-spin rounded-full border-muted-foreground border-t-base-foreground',
|
|
spinnerSizeClass
|
|
)
|
|
"
|
|
/>
|
|
<div class="col-start-1 row-start-1">
|
|
<slot />
|
|
</div>
|
|
</div>
|
|
<div v-if="loadingMessage" class="mt-4 text-lg text-base-foreground">
|
|
{{ loadingMessage }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</Transition>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
|
|
import { cn } from '@/utils/tailwindUtil'
|
|
|
|
const { size = 'md' } = defineProps<{
|
|
loading: boolean
|
|
loadingMessage?: string
|
|
size?: 'sm' | 'md'
|
|
}>()
|
|
|
|
const spinnerSizeClass = computed(() => {
|
|
switch (size) {
|
|
case 'sm':
|
|
return 'h-6 w-6 border-2'
|
|
case 'md':
|
|
default:
|
|
return 'h-12 w-12 border-4'
|
|
}
|
|
})
|
|
</script>
|