test(nodes): isolate cabinet regression suites (#517)
This commit is contained in:
@@ -2319,9 +2319,17 @@ describe('cabinet handles', () => {
|
||||
sceneApi: ReturnType<typeof sceneApiFixture>,
|
||||
) => HandleDescriptor<CabinetNode>[]
|
||||
const depthHandles = buildHandles(source, fixture.sceneApi).filter(
|
||||
(handle): handle is LinearResizeHandle<CabinetNode> =>
|
||||
handle.kind === 'linear-resize' &&
|
||||
handle.visible?.(source, fixture.sceneApi as never) !== false,
|
||||
(handle): handle is LinearResizeHandle<CabinetNode> => {
|
||||
if (
|
||||
handle.kind !== 'linear-resize' ||
|
||||
handle.visible?.(source, fixture.sceneApi as never) === false
|
||||
) {
|
||||
return false
|
||||
}
|
||||
const targetId = handle.overrideTarget?.(source, fixture.sceneApi as never) ?? source.id
|
||||
const target = fixture.sceneApi.get(targetId)
|
||||
return target?.type === 'cabinet' && target.runTier === 'base'
|
||||
},
|
||||
)
|
||||
return { ...fixture, depthHandles, source, thirdRun }
|
||||
}
|
||||
@@ -2613,6 +2621,7 @@ describe('cabinet handles', () => {
|
||||
[run, ...modules].map((node) => [node.id as AnyNodeId, node as AnyNode]),
|
||||
) as Record<AnyNodeId, AnyNode>
|
||||
const sceneApi = {
|
||||
get: (id: AnyNodeId) => nodes[id],
|
||||
nodes: () => nodes,
|
||||
}
|
||||
const rotateHandle = (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, mock, test } from 'bun:test'
|
||||
import { describe, expect, test } from 'bun:test'
|
||||
import type {
|
||||
AnyNode,
|
||||
AnyNodeId,
|
||||
@@ -8,19 +8,10 @@ import type {
|
||||
LinearResizeHandle,
|
||||
SceneApi,
|
||||
} from '@pascal-app/core'
|
||||
import { cabinetDefinition, cabinetModuleDefinition } from '../definition'
|
||||
import { addCornerRun } from '../run-ops'
|
||||
import { CabinetModuleNode, CabinetNode } from '../schema'
|
||||
|
||||
mock.module('../floorplan-move', () => ({ cabinetModuleFloorplanMoveTarget: () => null }))
|
||||
mock.module('../floorplan', () => ({
|
||||
buildCabinetFloorplan: () => null,
|
||||
buildCabinetModuleFloorplan: () => null,
|
||||
}))
|
||||
mock.module('../geometry', () => ({ buildCabinetGeometry: () => null }))
|
||||
mock.module('../paint', () => ({ cabinetPaint: {} }))
|
||||
|
||||
const { cabinetDefinition, cabinetModuleDefinition } = await import('../definition')
|
||||
|
||||
function wallDepthFixture() {
|
||||
const root = {
|
||||
...CabinetNode.parse({
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
import { describe, expect, mock, test } from 'bun:test'
|
||||
import { describe, expect, test } from 'bun:test'
|
||||
import type { WallNode, WallTrimConfig } from '@pascal-app/core'
|
||||
import { buildWallTreatmentLevelData } from './treatment-level-data'
|
||||
|
||||
mock.module('@pascal-app/viewer', () => ({
|
||||
baseMaterial: () => undefined,
|
||||
createMaterialFromPresetRef: () => undefined,
|
||||
resolveMaterialRef: () => undefined,
|
||||
}))
|
||||
|
||||
const { buildTrimGeometry, wallTreatmentProudOffsets } = await import('./treatments')
|
||||
import { buildTrimGeometry, wallTreatmentProudOffsets } from './treatments'
|
||||
|
||||
function wall(id: string, start: [number, number], end: [number, number]): WallNode {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user