|
@@ -15,7 +15,7 @@ describe('nodeOps', () => {
|
|
|
const props = { args: [] }
|
|
|
|
|
|
// Test
|
|
|
- const instance = nodeOps.createElement(tag, false, null, props)
|
|
|
+ const instance = nodeOps().createElement(tag, false, null, props)
|
|
|
|
|
|
// Assert
|
|
|
expect(instance.isObject3D).toBeTruthy()
|
|
@@ -28,7 +28,7 @@ describe('nodeOps', () => {
|
|
|
const props = { args: [10, 3, 16, 100] }
|
|
|
|
|
|
// Test
|
|
|
- const instance = nodeOps.createElement(tag, false, null, props)
|
|
|
+ const instance = nodeOps().createElement(tag, false, null, props)
|
|
|
|
|
|
// Assert
|
|
|
expect(instance.parameters.radius).toBe(10)
|
|
@@ -43,7 +43,7 @@ describe('nodeOps', () => {
|
|
|
const props = { args: [75, 2, 0.1, 5] }
|
|
|
|
|
|
// Test
|
|
|
- const instance = nodeOps.createElement(tag, false, null, props)
|
|
|
+ const instance = nodeOps().createElement(tag, false, null, props)
|
|
|
|
|
|
// Assert
|
|
|
expect(instance.isCamera).toBeTruthy()
|
|
@@ -60,7 +60,7 @@ describe('nodeOps', () => {
|
|
|
consoleWarnSpy.mockImplementation(() => { })
|
|
|
|
|
|
// Test
|
|
|
- const instance = nodeOps.createElement(tag, false, null, props)
|
|
|
+ const instance = nodeOps().createElement(tag, false, null, props)
|
|
|
|
|
|
// Assert
|
|
|
expect(instance.isCamera).toBeTruthy()
|
|
@@ -74,7 +74,7 @@ describe('nodeOps', () => {
|
|
|
const props = { args: [] }
|
|
|
|
|
|
// Test
|
|
|
- const instance = nodeOps.createElement(tag, false, null, props)
|
|
|
+ const instance = nodeOps().createElement(tag, false, null, props)
|
|
|
|
|
|
// Assert
|
|
|
expect(instance.isMaterial).toBeTruthy()
|
|
@@ -87,7 +87,7 @@ describe('nodeOps', () => {
|
|
|
const props = { args: [] }
|
|
|
|
|
|
// Test
|
|
|
- const instance = nodeOps.createElement(tag, false, null, props)
|
|
|
+ const instance = nodeOps().createElement(tag, false, null, props)
|
|
|
|
|
|
// Assert
|
|
|
expect(instance.isBufferGeometry).toBeTruthy()
|
|
@@ -115,7 +115,7 @@ describe('nodeOps', () => {
|
|
|
}
|
|
|
|
|
|
// Test
|
|
|
- nodeOps.insert(child, parent, null)
|
|
|
+ nodeOps().insert(child, parent, null)
|
|
|
|
|
|
// Assert
|
|
|
expect(parent.children.includes(child)).toBeTruthy()
|
|
@@ -130,10 +130,10 @@ describe('nodeOps', () => {
|
|
|
child.__vnode = {
|
|
|
type: 'TresMesh',
|
|
|
}
|
|
|
- nodeOps.insert(child, parent)
|
|
|
+ nodeOps().insert(child, parent)
|
|
|
|
|
|
// Test
|
|
|
- nodeOps.remove(child)
|
|
|
+ nodeOps().remove(child)
|
|
|
|
|
|
// Assert
|
|
|
expect(!parent.children.includes(child)).toBeTruthy()
|
|
@@ -151,7 +151,7 @@ describe('nodeOps', () => {
|
|
|
const nextValue = false
|
|
|
|
|
|
// Test
|
|
|
- nodeOps.patchProp(node, prop, null, nextValue)
|
|
|
+ nodeOps().patchProp(node, prop, null, nextValue)
|
|
|
|
|
|
// Assert
|
|
|
expect(node.visible === nextValue)
|
|
@@ -169,7 +169,7 @@ describe('nodeOps', () => {
|
|
|
const nextValue = 5
|
|
|
|
|
|
// Test
|
|
|
- nodeOps.patchProp(node, prop, null, nextValue)
|
|
|
+ nodeOps().patchProp(node, prop, null, nextValue)
|
|
|
|
|
|
// Assert
|
|
|
expect(node.position.x === nextValue)
|
|
@@ -187,7 +187,7 @@ describe('nodeOps', () => {
|
|
|
const nextValue = true
|
|
|
|
|
|
// Test
|
|
|
- nodeOps.patchProp(node, prop, null, nextValue)
|
|
|
+ nodeOps().patchProp(node, prop, null, nextValue)
|
|
|
|
|
|
// Assert
|
|
|
expect(node.castShadow === nextValue)
|
|
@@ -201,7 +201,7 @@ describe('nodeOps', () => {
|
|
|
child.parent = parent
|
|
|
|
|
|
// Test
|
|
|
- const parentNode = nodeOps.parentNode(child)
|
|
|
+ const parentNode = nodeOps().parentNode(child)
|
|
|
|
|
|
// Assert
|
|
|
expect(parentNode === parent)
|