test(load3d): add unit tests for 9 previously-untested controls (#11730)

## Summary
Mirror the maskeditor coverage approach for load3d sub-components. Each
component gets behavior tests covering rendering, conditional branches,
v-model bidirectional sync, and emitted events.

- ViewerLightControls: setting-store min/max/step + v-model
- ViewerExportControls: format dropdown + click-to-export
- ViewerCameraControls: type select, FOV slider visibility
- ViewerSceneControls: with/without bg image branches, render mode
- PopupSlider: trigger toggle, click-outside dismissal, defaults
- CameraControls: switch button, FOV PopupSlider visibility
- ExportControls: trigger popup, format selection, click-outside
- AnimationControls: empty-list bypass, controls, time formatting
- ViewerControls: dialog open routing + onClose wiring

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-11730-test-load3d-add-unit-tests-for-9-previously-untested-controls-3506d73d365081eaa9e7c5d0b922fc14)
by [Unito](https://www.unito.io)
This commit is contained in:
Terry Jia
2026-04-28 19:23:09 -04:00
committed by GitHub
parent e7640d414b
commit bb74ec94de
17 changed files with 2310 additions and 6 deletions

View File

@@ -6,6 +6,7 @@ import { createI18n } from 'vue-i18n'
import Load3dViewerContent from '@/components/load3d/Load3dViewerContent.vue'
import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
import { createMockLGraphNode } from '@/utils/__tests__/litegraphTestUtils'
class NoopMutationObserver {
observe() {}
@@ -129,7 +130,7 @@ type RenderOptions = {
dragOverrides?: Partial<ReturnType<typeof buildDragStub>>
}
const MOCK_NODE = { id: 'node-1', type: 'Load3D' } as unknown as LGraphNode
const MOCK_NODE = createMockLGraphNode({ id: 'node-1', type: 'Load3D' })
async function renderViewerContent(options: RenderOptions = {}) {
const viewerStub = buildViewerStub()