@@ -36,9 +36,8 @@ const createGetDataElementValue = (
3636 createGetDataElementDefinition = createGetDataElementDefinitionDefault
3737 } = { }
3838) => {
39- const getDataElementDefinition = createGetDataElementDefinition (
40- delegateDefinition
41- ) ;
39+ const getDataElementDefinition =
40+ createGetDataElementDefinition ( delegateDefinition ) ;
4241
4342 return createGetDataElementValueModule (
4443 moduleProvider ,
@@ -54,10 +53,9 @@ describe('function returned by createGetDataElementValue', () => {
5453 }
5554 } ) ;
5655
57- return getDataElementValue (
58- 'testDataElement' ,
59- defaultContext
60- ) . then ( ( dataElementValue ) => expect ( dataElementValue ) . toBe ( 'bar' ) ) ;
56+ return getDataElementValue ( 'testDataElement' , defaultContext ) . then (
57+ ( dataElementValue ) => expect ( dataElementValue ) . toBe ( 'bar' )
58+ ) ;
6159 } ) ;
6260
6361 test ( 'returns a value from the contextData object as value' , ( ) => {
@@ -78,10 +76,9 @@ describe('function returned by createGetDataElementValue', () => {
7876 { moduleProvider }
7977 ) ;
8078
81- return getDataElementValue (
82- 'testDataElement' ,
83- context
84- ) . then ( ( dataElementValue ) => expect ( dataElementValue ) . toBe ( 'bar' ) ) ;
79+ return getDataElementValue ( 'testDataElement' , context ) . then (
80+ ( dataElementValue ) => expect ( dataElementValue ) . toBe ( 'bar' )
81+ ) ;
8582 } ) ;
8683
8784 test ( 'cleans the value when cleanText = true' , ( ) => {
@@ -90,10 +87,9 @@ describe('function returned by createGetDataElementValue', () => {
9087 settings : { foo : 'bar' }
9188 } ) ;
9289
93- return getDataElementValue (
94- 'testDataElement' ,
95- defaultContext
96- ) . then ( ( dataElementValue ) => expect ( dataElementValue ) . toBe ( 'cleaned:bar' ) ) ;
90+ return getDataElementValue ( 'testDataElement' , defaultContext ) . then (
91+ ( dataElementValue ) => expect ( dataElementValue ) . toBe ( 'cleaned:bar' )
92+ ) ;
9793 } ) ;
9894
9995 [ undefined , null ] . forEach ( ( testDataElementValue ) => {
@@ -110,11 +106,8 @@ describe('function returned by createGetDataElementValue', () => {
110106 moduleProvider
111107 ) ;
112108
113- return getDataElementValue (
114- 'testDataElement' ,
115- defaultContext
116- ) . then ( ( dataElementValue ) =>
117- expect ( dataElementValue ) . toBe ( 'defaultValue' )
109+ return getDataElementValue ( 'testDataElement' , defaultContext ) . then (
110+ ( dataElementValue ) => expect ( dataElementValue ) . toBe ( 'defaultValue' )
118111 ) ;
119112 } ) ;
120113
@@ -127,11 +120,9 @@ describe('function returned by createGetDataElementValue', () => {
127120 { moduleProvider }
128121 ) ;
129122
130- return getDataElementValue (
131- 'testDataElement' ,
132- defaultContext
133- ) . then ( ( dataElementValue ) =>
134- expect ( dataElementValue ) . toBe ( testDataElementValue )
123+ return getDataElementValue ( 'testDataElement' , defaultContext ) . then (
124+ ( dataElementValue ) =>
125+ expect ( dataElementValue ) . toBe ( testDataElementValue )
135126 ) ;
136127 } ) ;
137128 } ) ;
@@ -150,11 +141,9 @@ describe('function returned by createGetDataElementValue', () => {
150141 { moduleProvider }
151142 ) ;
152143
153- return getDataElementValue (
154- 'testDataElement' ,
155- defaultContext
156- ) . then ( ( dataElementValue ) =>
157- expect ( dataElementValue ) . toBe ( testDataElementValue )
144+ return getDataElementValue ( 'testDataElement' , defaultContext ) . then (
145+ ( dataElementValue ) =>
146+ expect ( dataElementValue ) . toBe ( testDataElementValue )
158147 ) ;
159148 } ) ;
160149 } ) ;
@@ -167,10 +156,9 @@ describe('function returned by createGetDataElementValue', () => {
167156 }
168157 } ) ;
169158
170- return getDataElementValue (
171- 'testDataElement' ,
172- defaultContext
173- ) . then ( ( dataElementValue ) => expect ( dataElementValue ) . toBe ( 'bar' ) ) ;
159+ return getDataElementValue ( 'testDataElement' , defaultContext ) . then (
160+ ( dataElementValue ) => expect ( dataElementValue ) . toBe ( 'bar' )
161+ ) ;
174162 } ) ;
175163
176164 test ( 'lowercases the default value if forceLowerCase = true' , ( ) => {
@@ -180,10 +168,9 @@ describe('function returned by createGetDataElementValue', () => {
180168 settings : { }
181169 } ) ;
182170
183- return getDataElementValue (
184- 'testDataElement' ,
185- defaultContext
186- ) . then ( ( dataElementValue ) => expect ( dataElementValue ) . toBe ( 'bar' ) ) ;
171+ return getDataElementValue ( 'testDataElement' , defaultContext ) . then (
172+ ( dataElementValue ) => expect ( dataElementValue ) . toBe ( 'bar' )
173+ ) ;
187174 } ) ;
188175
189176 test ( 'throws an error when calling data element module exports fails' , ( ) => {
@@ -228,8 +215,8 @@ describe('function returned by createGetDataElementValue', () => {
228215 } )
229216 . catch ( ( e ) => {
230217 expect ( e . message ) . toMatch (
231- 'Failed to execute module for data element "testDataElement". \
232- noob tried to divide by zero'
218+ 'Failed to execute module for data element "testDataElement". ' +
219+ ' noob tried to divide by zero'
233220 ) ;
234221 } ) ;
235222 } ) ;
0 commit comments