|
@@ -101,12 +101,12 @@ describe('nodeOps', () => {
|
|
root: {
|
|
root: {
|
|
registerCamera: () => { },
|
|
registerCamera: () => { },
|
|
registerObjectAtPointerEventHandler: () => { },
|
|
registerObjectAtPointerEventHandler: () => { },
|
|
- }
|
|
|
|
|
|
+ },
|
|
}
|
|
}
|
|
const child = new Mesh()
|
|
const child = new Mesh()
|
|
|
|
|
|
child.__tres = {
|
|
child.__tres = {
|
|
- root: null
|
|
|
|
|
|
+ root: null,
|
|
}
|
|
}
|
|
|
|
|
|
// Fake vnodes
|
|
// Fake vnodes
|
|
@@ -145,7 +145,7 @@ describe('nodeOps', () => {
|
|
node.__tres = {
|
|
node.__tres = {
|
|
root: {
|
|
root: {
|
|
invalidate: () => { },
|
|
invalidate: () => { },
|
|
- }
|
|
|
|
|
|
+ },
|
|
}
|
|
}
|
|
const prop = 'visible'
|
|
const prop = 'visible'
|
|
const nextValue = false
|
|
const nextValue = false
|
|
@@ -163,7 +163,7 @@ describe('nodeOps', () => {
|
|
node.__tres = {
|
|
node.__tres = {
|
|
root: {
|
|
root: {
|
|
invalidate: () => { },
|
|
invalidate: () => { },
|
|
- }
|
|
|
|
|
|
+ },
|
|
}
|
|
}
|
|
const prop = 'position-x'
|
|
const prop = 'position-x'
|
|
const nextValue = 5
|
|
const nextValue = 5
|
|
@@ -181,7 +181,7 @@ describe('nodeOps', () => {
|
|
node.__tres = {
|
|
node.__tres = {
|
|
root: {
|
|
root: {
|
|
invalidate: () => { },
|
|
invalidate: () => { },
|
|
- }
|
|
|
|
|
|
+ },
|
|
}
|
|
}
|
|
const prop = 'cast-shadow'
|
|
const prop = 'cast-shadow'
|
|
const nextValue = true
|
|
const nextValue = true
|
|
@@ -195,19 +195,19 @@ describe('nodeOps', () => {
|
|
|
|
|
|
it('patchProp should preserve ALL_CAPS_CASE in pierced props', () => {
|
|
it('patchProp should preserve ALL_CAPS_CASE in pierced props', () => {
|
|
// Issue: https://github.com/Tresjs/tres/issues/605
|
|
// Issue: https://github.com/Tresjs/tres/issues/605
|
|
- const {createElement, patchProp} = nodeOps()
|
|
|
|
|
|
+ const { createElement, patchProp } = nodeOps()
|
|
const node = createElement('TresMeshStandardMaterial', null, null, {})
|
|
const node = createElement('TresMeshStandardMaterial', null, null, {})
|
|
const allCapsKey = 'STANDARD'
|
|
const allCapsKey = 'STANDARD'
|
|
const allCapsUnderscoresKey = 'USE_UVS'
|
|
const allCapsUnderscoresKey = 'USE_UVS'
|
|
const allCapsValue = 'hello'
|
|
const allCapsValue = 'hello'
|
|
const allCapsUnderscoresValue = 'goodbye'
|
|
const allCapsUnderscoresValue = 'goodbye'
|
|
|
|
|
|
- patchProp(node, 'defines-' + allCapsKey, null, allCapsValue)
|
|
|
|
- patchProp(node, 'defines-' + allCapsUnderscoresKey, null, allCapsUnderscoresValue)
|
|
|
|
|
|
+ patchProp(node, `defines-${allCapsKey}`, null, allCapsValue)
|
|
|
|
+ patchProp(node, `defines-${allCapsUnderscoresKey}`, null, allCapsUnderscoresValue)
|
|
|
|
|
|
expect(node.defines[allCapsKey]).equals(allCapsValue)
|
|
expect(node.defines[allCapsKey]).equals(allCapsValue)
|
|
expect(node.defines[allCapsUnderscoresKey]).equals(allCapsUnderscoresValue)
|
|
expect(node.defines[allCapsUnderscoresKey]).equals(allCapsUnderscoresValue)
|
|
- })
|
|
|
|
|
|
+ })
|
|
|
|
|
|
it('parentNode: returns parent of a node', async () => {
|
|
it('parentNode: returns parent of a node', async () => {
|
|
// Setup
|
|
// Setup
|