@@ -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
0 commit comments