Browse Source

feat(core): fixed nodeOps remove test (this time correctly 😉)

Tino Koch 2 years ago
parent
commit
f5fca28a1c
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/core/nodeOpts.test.ts

+ 5 - 5
src/core/nodeOpts.test.ts

@@ -108,16 +108,16 @@ describe('nodeOps', () => {
 
 
   it('remove: removes child from parent', async () => {
   it('remove: removes child from parent', async () => {
     // Setup
     // Setup
-    const scene = new Scene() as unknown as TresObject
-    const mesh = new Mesh() as unknown as TresObject
+    const parent = new Scene() as unknown as TresObject
+    const child = new Mesh() as unknown as TresObject
 
 
-    nodeOps.insert(mesh, scene)
+    nodeOps.insert(child, parent)
 
 
     // Test
     // Test
-    nodeOps.remove(mesh)
+    nodeOps.remove(child)
 
 
     // Assert
     // Assert
-    expect(!scene.children.length)
+    expect(!parent.children.includes(child)).toBeTruthy()
   })
   })
 
 
   it('patchProp should patch property of node', async () => {
   it('patchProp should patch property of node', async () => {