Skip to content

Commit 121a9b9

Browse files
committed
sq
1 parent 630fd82 commit 121a9b9

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

packages/form-js-viewer/test/spec/render/components/form-fields/ExpressionField.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('ExpressionField', function() {
2626
});
2727

2828

29-
it('should evaluate its expression on initialization when set to onChange', function() {
29+
it('should evaluate its expression on initialization when set to onChange', async function() {
3030

3131
// given
3232
const field = {
@@ -46,7 +46,7 @@ describe('ExpressionField', function() {
4646
const onChangeSpy = sinon.spy();
4747

4848
// when
49-
act(() => {
49+
await act(() => {
5050
createExpressionField({ field, onChange: onChangeSpy, services });
5151
});
5252

@@ -56,7 +56,7 @@ describe('ExpressionField', function() {
5656
});
5757

5858

59-
it('should re-evaluate when the expression result changes', function() {
59+
it('should re-evaluate when the expression result changes', async function() {
6060

6161
// given
6262
const field = {
@@ -82,7 +82,7 @@ describe('ExpressionField', function() {
8282
const { rerender } = createExpressionField({ field, onChange: onChangeSpy, services });
8383

8484
// when
85-
act(() => {
85+
await act(() => {
8686
rerender(
8787
<MockFormContext
8888
services={ services }
@@ -106,7 +106,7 @@ describe('ExpressionField', function() {
106106
});
107107

108108

109-
it('should not evaluate on intialization if computeOn presubmit', function() {
109+
it('should not evaluate on intialization if computeOn presubmit', async function() {
110110

111111
// given
112112
const field = {
@@ -128,7 +128,7 @@ describe('ExpressionField', function() {
128128
const onChangeSpy = sinon.spy();
129129

130130
// when
131-
act(() => {
131+
await act(() => {
132132
createExpressionField({ field, onChange: onChangeSpy, services });
133133
});
134134

@@ -138,7 +138,7 @@ describe('ExpressionField', function() {
138138
});
139139

140140

141-
it('should evaluate on presubmit', function() {
141+
it('should evaluate on presubmit', async function() {
142142

143143
// given
144144
const field = {
@@ -162,7 +162,7 @@ describe('ExpressionField', function() {
162162
createExpressionField({ field, onChange: onChangeSpy, services });
163163

164164
// when
165-
act(() => {
165+
await act(() => {
166166
services.eventBus.fire('presubmit');
167167
});
168168

packages/form-js-viewer/test/spec/render/components/form-fields/Select.spec.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,8 @@ describe('Select', function() {
270270
// given
271271
const focusSpy = spy();
272272

273-
let container;
274-
275-
await act(() => {
276-
container = createSelect({
277-
onFocus: focusSpy
278-
}).container;
273+
const { container } = createSelect({
274+
onFocus: focusSpy
279275
});
280276

281277
const select = container.querySelector('.fjs-input-group');

0 commit comments

Comments
 (0)