@@ -213,61 +213,64 @@ describe("expression", () => {
213213 it ( "empty string" , ( ) => {
214214 const input = " " ;
215215 const { ast, errors } = parseBinding ( input ) ;
216- const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors ) ;
216+ const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors , [ ] ) ;
217217 expect ( result ) . toBeTrue ( ) ;
218218 } ) ;
219219 it ( "string value" , ( ) => {
220220 const input = "40" ;
221221 const { ast, errors } = parseBinding ( input ) ;
222- const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors ) ;
222+ const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors , [ ] ) ;
223223 expect ( result ) . toBeFalse ( ) ;
224224 } ) ;
225225 it ( "empty curly bracket without space" , ( ) => {
226226 const input = "{}" ;
227227 const { ast, errors } = parseBinding ( input ) ;
228- const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors ) ;
228+ const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors , [ ] ) ;
229229 expect ( result ) . toBeTrue ( ) ;
230230 } ) ;
231231 it ( "empty curly bracket with space" , ( ) => {
232232 const input = "{ }" ;
233233 const { ast, errors } = parseBinding ( input ) ;
234- const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors ) ;
234+ const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors , [ ] ) ;
235235 expect ( result ) . toBeTrue ( ) ;
236236 } ) ;
237- it ( "key with colone [true]" , ( ) => {
237+ it ( "property binding info key with colon [true]" , ( ) => {
238238 const input = ' {path: "some/path"}' ;
239239 const { ast, errors } = parseBinding ( input ) ;
240- const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors ) ;
240+ const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors , [ "path" ] ) ;
241241 expect ( result ) . toBeTrue ( ) ;
242242 } ) ;
243- it ( "key with colone any where [true]" , ( ) => {
244- const input = ' {path "some/path", thisKey : {}}' ;
243+ it ( "property binding info key with colon any where [true]" , ( ) => {
244+ const input = ' {path "some/path", event : {}}' ;
245245 const { ast, errors } = parseBinding ( input ) ;
246- const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors ) ;
246+ const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors , [
247+ "path" ,
248+ "event" ,
249+ ] ) ;
247250 expect ( result ) . toBeTrue ( ) ;
248251 } ) ;
249252 it ( "missing colon [false]" , ( ) => {
250253 const input = '{path "some/path"}' ;
251254 const { ast, errors } = parseBinding ( input ) ;
252- const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors ) ;
255+ const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors , [ "path" ] ) ;
253256 expect ( result ) . toBeFalse ( ) ;
254257 } ) ;
255258 it ( "contains > after first key [false]" , ( ) => {
256259 const input = "{i18n>myTestModel}" ;
257260 const { ast, errors } = parseBinding ( input ) ;
258- const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors ) ;
261+ const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors , [ "path" ] ) ;
259262 expect ( result ) . toBeFalse ( ) ;
260263 } ) ;
261264 it ( "contains / before first key [false]" , ( ) => {
262265 const input = "{/oData/path/to/some/dynamic/value}" ;
263266 const { ast, errors } = parseBinding ( input ) ;
264- const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors ) ;
267+ const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors , [ "path" ] ) ;
265268 expect ( result ) . toBeFalse ( ) ;
266269 } ) ;
267270 it ( "contains / after first key [false]" , ( ) => {
268271 const input = "{/oData/path/to/some/dynamic/value}" ;
269272 const { ast, errors } = parseBinding ( input ) ;
270- const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors ) ;
273+ const result = isBindingAllowed ( input , ast . bindings [ 0 ] , errors , [ "path" ] ) ;
271274 expect ( result ) . toBeFalse ( ) ;
272275 } ) ;
273276 } ) ;
0 commit comments