@domql/element 3.1.2 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +4 -6
  2. package/__tests__/checkIfOnUpdate.test.js +12 -12
  3. package/__tests__/children.test.js +34 -38
  4. package/__tests__/inheritStateUpdates.test.js +12 -12
  5. package/__tests__/renderElement.test.js +11 -11
  6. package/__tests__/resetElement.test.js +6 -6
  7. package/__tests__/set.test.js +32 -36
  8. package/__tests__/throughExecProps.test.js +12 -12
  9. package/__tests__/throughInitialDefine.test.js +16 -16
  10. package/__tests__/throughInitialExec.test.js +16 -16
  11. package/__tests__/throughUpdatedDefine.test.js +14 -14
  12. package/__tests__/throughUpdatedExec.test.js +17 -16
  13. package/__tests__/update.test.js +54 -54
  14. package/children.js +5 -6
  15. package/create.js +18 -20
  16. package/dist/cjs/children.js +4 -2
  17. package/dist/cjs/create.js +16 -16
  18. package/dist/cjs/extend.js +88 -0
  19. package/dist/cjs/iterate.js +76 -20
  20. package/dist/cjs/mixins/content.js +73 -0
  21. package/dist/cjs/mixins/html.js +1 -1
  22. package/dist/cjs/mixins/registry.js +2 -2
  23. package/dist/cjs/mixins/scope.js +1 -1
  24. package/dist/cjs/mixins/state.js +2 -2
  25. package/dist/cjs/mixins/text.js +4 -4
  26. package/dist/cjs/node.js +15 -15
  27. package/dist/cjs/set.js +22 -27
  28. package/dist/cjs/update.js +24 -33
  29. package/dist/cjs/utils/applyParam.js +4 -4
  30. package/dist/cjs/utils/extendUtils.js +132 -0
  31. package/dist/cjs/utils/propEvents.js +39 -0
  32. package/dist/esm/children.js +5 -3
  33. package/dist/esm/create.js +16 -16
  34. package/dist/esm/extend.js +74 -0
  35. package/dist/esm/iterate.js +77 -22
  36. package/dist/esm/mixins/content.js +53 -0
  37. package/dist/esm/mixins/html.js +1 -1
  38. package/dist/esm/mixins/registry.js +1 -1
  39. package/dist/esm/mixins/scope.js +1 -1
  40. package/dist/esm/mixins/state.js +3 -3
  41. package/dist/esm/mixins/text.js +4 -4
  42. package/dist/esm/node.js +15 -15
  43. package/dist/esm/set.js +23 -28
  44. package/dist/esm/update.js +24 -33
  45. package/dist/esm/utils/applyParam.js +5 -5
  46. package/dist/esm/utils/extendUtils.js +119 -0
  47. package/dist/esm/utils/propEvents.js +19 -0
  48. package/extend.js +98 -0
  49. package/iterate.js +80 -25
  50. package/mixins/content.js +65 -0
  51. package/mixins/html.js +1 -1
  52. package/mixins/registry.js +1 -1
  53. package/mixins/scope.js +1 -1
  54. package/mixins/state.js +3 -3
  55. package/mixins/text.js +4 -4
  56. package/node.js +15 -15
  57. package/package.json +8 -8
  58. package/set.js +23 -28
  59. package/update.js +25 -34
  60. package/utils/applyParam.js +5 -5
  61. package/utils/extendUtils.js +149 -0
  62. package/utils/propEvents.js +19 -0
  63. package/dist/cjs/__tests__/checkIfOnUpdate.test.js +0 -73
  64. package/dist/cjs/__tests__/children.test.js +0 -177
  65. package/dist/cjs/__tests__/define.test.js +0 -75
  66. package/dist/cjs/__tests__/inheritStateUpdates.test.js +0 -62
  67. package/dist/cjs/__tests__/renderElement.test.js +0 -138
  68. package/dist/cjs/__tests__/resetElement.test.js +0 -35
  69. package/dist/cjs/__tests__/set.test.js +0 -256
  70. package/dist/cjs/__tests__/throughExecProps.test.js +0 -62
  71. package/dist/cjs/__tests__/throughInitialDefine.test.js +0 -79
  72. package/dist/cjs/__tests__/throughInitialExec.test.js +0 -73
  73. package/dist/cjs/__tests__/throughUpdatedDefine.test.js +0 -69
  74. package/dist/cjs/__tests__/throughUpdatedExec.test.js +0 -84
  75. package/dist/cjs/__tests__/tree.test.js +0 -11
  76. package/dist/cjs/__tests__/update.test.js +0 -222
  77. package/dist/esm/__tests__/checkIfOnUpdate.test.js +0 -73
  78. package/dist/esm/__tests__/children.test.js +0 -177
  79. package/dist/esm/__tests__/define.test.js +0 -53
  80. package/dist/esm/__tests__/inheritStateUpdates.test.js +0 -62
  81. package/dist/esm/__tests__/renderElement.test.js +0 -116
  82. package/dist/esm/__tests__/resetElement.test.js +0 -35
  83. package/dist/esm/__tests__/set.test.js +0 -256
  84. package/dist/esm/__tests__/throughExecProps.test.js +0 -62
  85. package/dist/esm/__tests__/throughInitialDefine.test.js +0 -79
  86. package/dist/esm/__tests__/throughInitialExec.test.js +0 -73
  87. package/dist/esm/__tests__/throughUpdatedDefine.test.js +0 -69
  88. package/dist/esm/__tests__/throughUpdatedExec.test.js +0 -84
  89. package/dist/esm/__tests__/tree.test.js +0 -11
  90. package/dist/esm/__tests__/update.test.js +0 -222
package/README.md CHANGED
@@ -9,12 +9,10 @@ import DOM from 'domql'
9
9
 
10
10
  const Poster = {
11
11
  extends: [Link, Img],
12
- props: {
13
- boxSize: [100, 200],
14
- borderRadius: 12,
15
- padding: 16,
16
- background: '#fff'
17
- }
12
+ boxSize: [100, 200],
13
+ borderRadius: 12,
14
+ padding: 16,
15
+ background: '#fff'
18
16
  }
19
17
 
20
18
  DOM.create(Poster, document.body)
@@ -44,60 +44,60 @@ describe('checkIfOnUpdate via update()', () => {
44
44
  options = {}
45
45
  })
46
46
 
47
- it('uses props.if when element.if missing', async () => {
47
+ it('uses props.if when element.if missing', () => {
48
48
  delete element.if
49
49
  element.props.if = () => false
50
- await update.call(element, {}, options)
50
+ update.call(element, {}, options)
51
51
  expect(element.node).toEqual(document.createElement('div'))
52
52
  })
53
53
 
54
- it('retains state when __hasRootState=true', async () => {
54
+ it('retains state when __hasRootState=true', () => {
55
55
  element.__ref.__hasRootState = true
56
56
  element.state.critical = true
57
57
  element.__ref.__if = false
58
58
 
59
- await update.call(element, {}, options)
59
+ update.call(element, {}, options)
60
60
 
61
61
  expect(element.state.critical).toBe(true)
62
62
  expect(element.state.preserved).toBeUndefined()
63
63
  })
64
64
 
65
- it('processes nested content with parseDeep', async () => {
65
+ it('processes nested content with parseDeep', () => {
66
66
  element.content = {
67
67
  parseDeep: () => ({ parsed: true }),
68
68
  existing: 'data'
69
69
  }
70
70
 
71
- await update.call(element, {}, options)
71
+ update.call(element, {}, options)
72
72
 
73
73
  expect(element.content.parsed).toBe(true)
74
74
  expect(element.content.existing).toBeUndefined()
75
75
  })
76
76
 
77
- it('reattaches after previous sibling', async () => {
77
+ it('reattaches after previous sibling', () => {
78
78
  const prevNode = document.createElement('span')
79
79
  parent.node.appendChild(prevNode)
80
80
 
81
- await update.call(element, {}, options)
81
+ update.call(element, {}, options)
82
82
 
83
83
  const newElement = parent.node.children[0]
84
84
  expect(newElement).toEqual(document.createElement('span'))
85
85
  expect(newElement.previousSibling).toBe(null)
86
86
  })
87
87
 
88
- // it('reattaches before next sibling', async () => {
88
+ // it('reattaches before next sibling', () => {
89
89
  // const nextNode = document.createElement('p')
90
90
  // parent.node.appendChild(nextNode)
91
91
 
92
- // await update.call(element, {}, options)
92
+ // update.call(element, {}, options)
93
93
 
94
94
  // const newElement = parent.node.children[0]
95
95
  // expect(newElement).toEqual(document.createElement('p'))
96
96
  // expect(newElement.nextSibling).toBe(null)
97
97
  // })
98
98
 
99
- // it('appends to parent when no siblings exist', async () => {
100
- // await update.call(element, {}, options)
99
+ // it('appends to parent when no siblings exist', () => {
100
+ // update.call(element, {}, options)
101
101
  // expect(parent.node.children).toHaveLength(0)
102
102
  // })
103
103
  })
@@ -16,23 +16,23 @@ describe('children', () => {
16
16
  node = {}
17
17
  })
18
18
 
19
- it('handles null/undefined params', async () => {
20
- const result = await setChildren(null, element, node)
19
+ it('handles null/undefined params', () => {
20
+ const result = setChildren(null, element, node)
21
21
  expect(result).toBeUndefined()
22
22
  })
23
23
 
24
- it('handles direct string children', async () => {
25
- const result = await setChildren('Hello World', element, node)
24
+ it('handles direct string children', () => {
25
+ const result = setChildren('Hello World', element, node)
26
26
  expect(result).toEqual({ tag: 'fragment', 0: { text: 'Hello World' } })
27
27
  })
28
28
 
29
- it('handles numeric children', async () => {
30
- const result = await setChildren(42, element, node)
29
+ it('handles numeric children', () => {
30
+ const result = setChildren(42, element, node)
31
31
  expect(result).toEqual({ tag: 'fragment', 0: { text: 42 } })
32
32
  })
33
33
 
34
- it('handles array of primitive values with childrenAs prop', async () => {
35
- const result = await setChildren(['one', 'two'], element, node)
34
+ it('handles array of primitive values with childrenAs prop', () => {
35
+ const result = setChildren(['one', 'two'], element, node)
36
36
 
37
37
  expect(result).toEqual({
38
38
  tag: 'fragment',
@@ -41,9 +41,9 @@ describe('children', () => {
41
41
  })
42
42
  })
43
43
 
44
- it('handles array of primitive values with childrenAs state', async () => {
44
+ it('handles array of primitive values with childrenAs state', () => {
45
45
  element.props.childrenAs = 'state'
46
- const result = await setChildren(['one', 'two'], element, node)
46
+ const result = setChildren(['one', 'two'], element, node)
47
47
 
48
48
  expect(result).toEqual({
49
49
  tag: 'fragment',
@@ -52,34 +52,34 @@ describe('children', () => {
52
52
  })
53
53
  })
54
54
 
55
- it('caches children and detects changes', async () => {
55
+ it('caches children and detects changes', () => {
56
56
  const children1 = [{ id: 1 }, { id: 2 }]
57
57
  const children2 = [{ id: 1 }, { id: 2 }]
58
58
  const children3 = [{ id: 1 }, { id: 3 }]
59
59
 
60
60
  // First call
61
- await setChildren(children1, element, node)
61
+ setChildren(children1, element, node)
62
62
  expect(element.__ref.__childrenCache).toEqual(children1)
63
63
  expect(element.__ref.__noChildrenDifference).toBeUndefined()
64
64
 
65
65
  // Same content, different reference
66
- await setChildren(children2, element, node)
66
+ setChildren(children2, element, node)
67
67
  expect(element.__ref.__noChildrenDifference).toBe(true)
68
68
 
69
69
  // Different content
70
- await setChildren(children3, element, node)
70
+ setChildren(children3, element, node)
71
71
  expect(element.__ref.__noChildrenDifference).toBeUndefined()
72
72
  expect(element.__ref.__childrenCache).toEqual(children3)
73
73
  })
74
74
 
75
- it('handles mixed React and normal components', async () => {
75
+ it('handles mixed React and normal components', () => {
76
76
  const mixedChildren = [
77
77
  { type: 'div', text: 'Normal' },
78
78
  { $$typeof: Symbol('react') },
79
79
  { type: 'span', text: 'Another' }
80
80
  ]
81
81
 
82
- await setChildren(mixedChildren, element, node)
82
+ setChildren(mixedChildren, element, node)
83
83
 
84
84
  expect(element.call).toHaveBeenCalledWith(
85
85
  'renderReact',
@@ -88,13 +88,13 @@ describe('children', () => {
88
88
  )
89
89
  })
90
90
 
91
- it('handles state-based children', async () => {
91
+ it('handles state-based children', () => {
92
92
  element.state = {
93
93
  items: ['a', 'b'],
94
94
  parse: () => ['parsed a', 'parsed b']
95
95
  }
96
96
 
97
- const result = await setChildren('state', element, node)
97
+ const result = setChildren('state', element, node)
98
98
  expect(result).toEqual({
99
99
  tag: 'fragment',
100
100
  0: { text: 'parsed a' },
@@ -102,9 +102,9 @@ describe('children', () => {
102
102
  })
103
103
  })
104
104
 
105
- it('handles async function parameters', async () => {
106
- const asyncParam = async () => ['async1', 'async2']
107
- const result = await setChildren(asyncParam, element, node)
105
+ it('handles async function parameters', () => {
106
+ const asyncParam = () => ['async1', 'async2']
107
+ const result = setChildren(asyncParam, element, node)
108
108
 
109
109
  expect(result).toEqual({
110
110
  tag: 'fragment',
@@ -113,7 +113,7 @@ describe('children', () => {
113
113
  })
114
114
  })
115
115
 
116
- it('handles nested object structures', async () => {
116
+ it('handles nested object structures', () => {
117
117
  const nestedChildren = {
118
118
  header: { text: 'Title' },
119
119
  content: {
@@ -121,7 +121,7 @@ describe('children', () => {
121
121
  }
122
122
  }
123
123
 
124
- const result = await setChildren(nestedChildren, element, node)
124
+ const result = setChildren(nestedChildren, element, node)
125
125
  expect(result).toEqual({
126
126
  tag: 'fragment',
127
127
  0: { text: 'Title' },
@@ -129,24 +129,20 @@ describe('children', () => {
129
129
  })
130
130
  })
131
131
 
132
- it('handles empty arrays and objects', async () => {
133
- let result = await setChildren([], element, node)
132
+ it('handles empty arrays and objects', () => {
133
+ let result = setChildren([], element, node)
134
134
  expect(result).toEqual({
135
135
  tag: 'fragment'
136
136
  })
137
137
 
138
- result = await setChildren({}, element, node)
138
+ result = setChildren({}, element, node)
139
139
  expect(result).toEqual({
140
140
  tag: 'fragment'
141
141
  })
142
142
  })
143
143
 
144
- it('handles falsy values in arrays', async () => {
145
- const result = await setChildren(
146
- [null, undefined, false, 0, ''],
147
- element,
148
- node
149
- )
144
+ it('handles falsy values in arrays', () => {
145
+ const result = setChildren([null, undefined, false, 0, ''], element, node)
150
146
  expect(result).toEqual({
151
147
  tag: 'fragment',
152
148
  3: { text: 0 },
@@ -154,7 +150,7 @@ describe('children', () => {
154
150
  })
155
151
  })
156
152
 
157
- it('handles React components with falsy values in array', async () => {
153
+ it('handles React components with falsy values in array', () => {
158
154
  const mixedChildren = [
159
155
  null,
160
156
  { $$typeof: Symbol('react') },
@@ -163,7 +159,7 @@ describe('children', () => {
163
159
  false
164
160
  ]
165
161
 
166
- await setChildren(mixedChildren, element, node)
162
+ setChildren(mixedChildren, element, node)
167
163
 
168
164
  expect(element.call).toHaveBeenCalledWith(
169
165
  'renderReact',
@@ -172,7 +168,7 @@ describe('children', () => {
172
168
  )
173
169
  })
174
170
 
175
- it('handles nested state parsing', async () => {
171
+ it('handles nested state parsing', () => {
176
172
  element.state = {
177
173
  nested: {
178
174
  items: ['c', 'd']
@@ -180,20 +176,20 @@ describe('children', () => {
180
176
  }
181
177
  element.state.nested.__proto__.parse = () => ['parsed c', 'parsed d']
182
178
 
183
- const result = await setChildren('nested', element, node)
179
+ const result = setChildren('nested', element, node)
184
180
  expect(result).toEqual({
185
181
  tag: 'fragment',
186
182
  0: { state: ['c', 'd'] }
187
183
  })
188
184
  })
189
185
 
190
- it('handles mixed state and regular objects', async () => {
186
+ it('handles mixed state and regular objects', () => {
191
187
  element.state = {
192
188
  header: { parse: () => 'Header' },
193
189
  footer: { parse: () => 'Footer' }
194
190
  }
195
191
 
196
- const result = await setChildren(
192
+ const result = setChildren(
197
193
  {
198
194
  header: 'header',
199
195
  content: { text: 'Content' },
@@ -28,52 +28,52 @@ describe('update() with inheritStateUpdates', () => {
28
28
  })
29
29
 
30
30
  // Test 1: Continue update when state inheritance succeeds
31
- it('processes full update flow when state is inherited', async () => {
32
- await update.call(element, { props: { newProp: true } }, options)
31
+ it('processes full update flow when state is inherited', () => {
32
+ update.call(element, { props: { newProp: true } }, options)
33
33
  expect(element.props.newProp).toBe(true)
34
34
  expect(element.state.baseState).toBe(true) // Inherited from parent
35
35
  })
36
36
 
37
37
  // Test 2: Preserve existing state when inheritance blocked
38
- it('maintains state when preventInheritedStateUpdate=true', async () => {
38
+ it('maintains state when preventInheritedStateUpdate=true', () => {
39
39
  options.preventInheritedStateUpdate = true
40
40
  element.state = { existing: 'state' }
41
41
 
42
- await update.call(element, {}, options)
42
+ update.call(element, {}, options)
43
43
  expect(element.state).toEqual({ baseState: true })
44
44
  })
45
45
 
46
46
  // Test 3: Execute state functions when forced
47
- it('overwrites state with function result', async () => {
47
+ it('overwrites state with function result', () => {
48
48
  element.__ref.__state = () => ({ calculated: 42 })
49
49
  options.execStateFunction = true
50
50
  options.stateFunctionOverwrite = true
51
51
 
52
- await update.call(element, {}, options)
52
+ update.call(element, {}, options)
53
53
  expect(element.state.calculated).toEqual(42)
54
54
  })
55
55
 
56
56
  // Test 4: Block updates via beforeStateUpdate event
57
- it('preserves state when beforeStateUpdate rejects', async () => {
57
+ it('preserves state when beforeStateUpdate rejects', () => {
58
58
  element.onBeforeStateUpdate = () => false
59
- await update.call(element, { props: { shouldChange: true } }, options)
59
+ update.call(element, { props: { shouldChange: true } }, options)
60
60
  expect(element.state).toEqual({ baseState: true })
61
61
  expect(element.props.shouldChange).toBe(true)
62
62
  })
63
63
 
64
64
  // Test 5: Handle parent state changes
65
- it('reflects parent state updates', async () => {
65
+ it('reflects parent state updates', () => {
66
66
  element.parent.state = { updatedParentState: true }
67
- await update.call(element, {}, options)
67
+ update.call(element, {}, options)
68
68
  expect(element.state.updatedParentState).toBe(true)
69
69
  })
70
70
 
71
71
  // Test 6: Maintain local state when root state exists
72
- it('preserves local state when __hasRootState=true', async () => {
72
+ it('preserves local state when __hasRootState=true', () => {
73
73
  element.__ref.__hasRootState = true
74
74
  element.state = { local: 'data' }
75
75
 
76
- await update.call(element, {}, options)
76
+ update.call(element, {}, options)
77
77
  expect(element.state.local).toBe('data')
78
78
  })
79
79
  })
@@ -33,7 +33,7 @@ describe('create()', () => {
33
33
  props.__ref.__skipCreate = true
34
34
  props.scope = undefined
35
35
  const { create } = await import('../create')
36
- await create(props, parent, 'passedKey', {
36
+ create(props, parent, 'passedKey', {
37
37
  onlyResolveExtends: true,
38
38
  define: ['test']
39
39
  })
@@ -45,7 +45,7 @@ describe('create()', () => {
45
45
  props.__ref.__if = true
46
46
  props.scope = 'state'
47
47
  const { create } = await import('../create')
48
- await create(props, parent, 'passedKey', {
48
+ create(props, parent, 'passedKey', {
49
49
  onlyResolveExtends: true,
50
50
  define: ['test']
51
51
  })
@@ -57,7 +57,7 @@ describe('create()', () => {
57
57
  process.env.NODE_ENV = 'prod'
58
58
  props.__ref = undefined
59
59
  const { create } = await import('../create')
60
- await create(props, parent, 'passedKey', { onlyResolveExtends: true })
60
+ create(props, parent, 'passedKey', { onlyResolveExtends: true })
61
61
  expect(parent.__ref).toBeUndefined()
62
62
  expect(parent.passedKey).toBe(props.__ref.parent.passedKey)
63
63
  })
@@ -66,7 +66,7 @@ describe('create()', () => {
66
66
  process.env.NODE_ENV = 'prod'
67
67
  props.__ref = undefined
68
68
  const { create } = await import('../create')
69
- await create(props, parent, 'passedKey')
69
+ create(props, parent, 'passedKey')
70
70
  expect(parent.__ref).toBeUndefined()
71
71
  expect(parent.passedKey).toBe(props.__ref.parent.passedKey)
72
72
  })
@@ -74,7 +74,7 @@ describe('create()', () => {
74
74
  test('should attaches element to parent when ref.__if is false', async () => {
75
75
  process.env.NODE_ENV = 'prod'
76
76
  const { create } = await import('../create')
77
- await create(props, parent, 'passedKey')
77
+ create(props, parent, 'passedKey')
78
78
  expect(parent.__ref).toBeUndefined()
79
79
  expect(parent.passedKey).toBe(props.__ref.parent.passedKey)
80
80
  })
@@ -83,7 +83,7 @@ describe('create()', () => {
83
83
  process.env.NODE_ENV = 'prod'
84
84
  props.__if = true
85
85
  const { create } = await import('../create')
86
- await create(props, parent, 'passedKey')
86
+ create(props, parent, 'passedKey')
87
87
  expect(parent.testKey).toBe('parentTestKey')
88
88
  expect(parent.passedKey).toBe(props.__ref.parent.passedKey)
89
89
  })
@@ -92,7 +92,7 @@ describe('create()', () => {
92
92
  process.env.NODE_ENV = 'prod'
93
93
  props.__ref = { __uniqId: 'existing-id', path: [] }
94
94
  const { create } = await import('../create')
95
- await create(props, {}, 'passedKey')
95
+ create(props, {}, 'passedKey')
96
96
  expect(props.__ref.__uniqId).toBeDefined()
97
97
  })
98
98
 
@@ -100,7 +100,7 @@ describe('create()', () => {
100
100
  process.env.NODE_ENV = 'prod'
101
101
  props.__ref = { path: ['loop-path'], __uniqId: undefined }
102
102
  const { create } = await import('../create')
103
- await create(props, {}, 'passedKey')
103
+ create(props, {}, 'passedKey')
104
104
  expect(props.__ref.__uniqId).toBeDefined()
105
105
  })
106
106
 
@@ -108,7 +108,7 @@ describe('create()', () => {
108
108
  process.env.NODE_ENV = 'prod'
109
109
  props.__ref = { path: ['ComponentsGrid', 'x', 'y', 'z'] }
110
110
  const { create } = await import('../create')
111
- await create(props, {}, ['ComponentsGrid', 'x', 'y', 'z'])
111
+ create(props, {}, ['ComponentsGrid', 'x', 'y', 'z'])
112
112
  expect(props.__ref.path).toEqual(['ComponentsGrid,x,y,z'])
113
113
  })
114
114
 
@@ -116,7 +116,7 @@ describe('create()', () => {
116
116
  process.env.NODE_ENV = 'prod'
117
117
  props.__ref = { path: ['demoComponent', 'a', 'b', 'c'] }
118
118
  const { create } = await import('../create')
119
- await create(props, {}, ['demoComponent', 'a', 'b', 'c'])
119
+ create(props, {}, ['demoComponent', 'a', 'b', 'c'])
120
120
  expect(props.__ref.path).toEqual(['demoComponent,a,b,c'])
121
121
  })
122
122
 
@@ -125,7 +125,7 @@ describe('create()', () => {
125
125
  props.__ref = { __if: false, path: [] }
126
126
  props.key = 'fallbackKey'
127
127
  const { create } = await import('../create')
128
- await create(props, parent, null)
128
+ create(props, parent, null)
129
129
  expect(props.__ref.parent.fallbackKey).toBeDefined()
130
130
  })
131
131
  })
@@ -15,15 +15,15 @@ describe('resetContent', () => {
15
15
  }
16
16
  })
17
17
 
18
- it('should update contentElementKey from options', async () => {
19
- await resetContent({}, element, { contentElementKey: 'mainContent' })
18
+ it('should update contentElementKey from options', () => {
19
+ resetContent({}, element, { contentElementKey: 'mainContent' })
20
20
 
21
21
  expect(ref.contentElementKey).toBe('mainContent')
22
22
  expect(element.mainContent).toBeDefined()
23
23
  })
24
24
 
25
- it('should merge options correctly', async () => {
26
- await resetContent({}, element, { customOption: true })
25
+ it('should merge options correctly', () => {
26
+ resetContent({}, element, { customOption: true })
27
27
 
28
28
  expect(element.content).toEqual(
29
29
  expect.objectContaining({
@@ -33,10 +33,10 @@ describe('resetContent', () => {
33
33
  )
34
34
  })
35
35
 
36
- it('should maintain context through reset', async () => {
36
+ it('should maintain context through reset', () => {
37
37
  const originalContext = element.context
38
38
 
39
- await resetContent({}, element, {})
39
+ resetContent({}, element, {})
40
40
 
41
41
  expect(element.context).toBe(originalContext)
42
42
  expect(element.content.context).toBe(originalContext)