@@ -399,7 +399,7 @@ describe('ValidationsDispatcher', () => {
399399 } ) ;
400400 } ) ;
401401
402- it ( 'Spec #11 => should return empty FieldValidationResult and calls to validation functions ' +
402+ it ( 'Spec #12 => should return empty FieldValidationResult and calls to validation functions ' +
403403 'When passing vm equals undefined, value equals undefined and validationsPerField equals array with one item ' +
404404 'equals validation function resolving a fieldValidationResult equals ""' , ( done ) => {
405405 //Arrange
@@ -433,7 +433,7 @@ describe('ValidationsDispatcher', () => {
433433 } ) ;
434434 } ) ;
435435
436- it ( 'Spec #12 => should return undefined FieldValidationResult and calls to first validation function ' +
436+ it ( 'Spec #13 => should return undefined FieldValidationResult and calls to first validation function ' +
437437 'When passing vm equals undefined, value equals undefined and validationsPerField equals array with two items ' +
438438 'first equals validation function resolving a fieldValidationResult equals undefined' +
439439 'second equals successful validation function' , ( done ) => {
@@ -484,7 +484,7 @@ describe('ValidationsDispatcher', () => {
484484 } ) ;
485485 } ) ;
486486
487- it ( 'Spec #13 => should return undefined FieldValidationResult and calls to first validation function ' +
487+ it ( 'Spec #14 => should return undefined FieldValidationResult and calls to first validation function ' +
488488 'When passing vm equals undefined, value equals undefined and validationsPerField equals array with two items ' +
489489 'first equals validation function resolving a fieldValidationResult equals undefined' +
490490 'second equals failed validation function' , ( done ) => {
@@ -534,7 +534,7 @@ describe('ValidationsDispatcher', () => {
534534 } ) ;
535535 } ) ;
536536
537- it ( 'Spec #14 => should return failed and key equals "test1" FieldValidationResult and calls to first validation function ' +
537+ it ( 'Spec #15 => should return failed and key equals "test1" FieldValidationResult and calls to first validation function ' +
538538 'When passing vm equals undefined, value equals undefined and validationsPerField equals array with two items ' +
539539 'first equals failed validation function' +
540540 'second equals validation function resolving a fieldValidationResult equals undefined' , ( done ) => {
@@ -586,7 +586,7 @@ describe('ValidationsDispatcher', () => {
586586 } ) ;
587587 } ) ;
588588
589- it ( 'Spec #15 => should return undefined FieldValidationResult and calls to first and second validation functions ' +
589+ it ( 'Spec #16 => should return undefined FieldValidationResult and calls to first and second validation functions ' +
590590 'When passing vm equals undefined, value equals undefined and validationsPerField equals array with two items ' +
591591 'first equals successful validation function' +
592592 'second equals validation function resolving a fieldValidationResult equals undefined' , ( done ) => {
@@ -636,7 +636,7 @@ describe('ValidationsDispatcher', () => {
636636 } ) ;
637637 } ) ;
638638
639- it ( 'should pass customParams to its proper validationFunction' , ( done ) => {
639+ it ( 'Spec #17 => should pass customParams to its proper validationFunction' , ( done ) => {
640640 //Arrange
641641 const vm = undefined ;
642642 const value = undefined ;
@@ -800,7 +800,7 @@ describe('ValidationsDispatcher', () => {
800800 } ) ;
801801
802802 it ( 'Spec #9 => should return empty array and should not call to validationFn ' +
803- 'when passing vm equals { }, vmKeys as non empty array and validationFn equals function' , ( ) => {
803+ 'when passing vm equals { testVmProperty: "" }, vmKeys equals ["otherProperty"] and validationFn equals function' , ( ) => {
804804 //Arrange
805805 const vm = {
806806 testVmProperty : ''
@@ -816,8 +816,8 @@ describe('ValidationsDispatcher', () => {
816816 expect ( validationFnSpy . called ) . to . be . false ;
817817 } ) ;
818818
819- it ( 'Spec #10 => should not return empty array with one item and it calls to validationFn ' +
820- 'when passing vm equals { testVmProperty: "test" }, vmKeys equals [] and validationFn equals function' , ( ) => {
819+ it ( 'Spec #10 => should return array with one item and it calls to validationFn ' +
820+ 'when passing vm equals { testVmProperty: "test" }, vmKeys equals [testVmProperty ] and validationFn equals function' , ( ) => {
821821 //Arrange
822822 const vm = {
823823 testVmProperty : 'test'
@@ -828,6 +828,25 @@ describe('ValidationsDispatcher', () => {
828828 //Act
829829 const fieldValidationResultPromises = validationsDispatcher . fireAllFieldsValidations ( vm , vmKeys , validationFnSpy ) ;
830830
831+ //Ass
832+ expect ( fieldValidationResultPromises ) . to . have . length ( 1 ) ;
833+ expect ( validationFnSpy . called ) . to . be . true ;
834+ } ) ;
835+
836+ it ( 'Spec #11 => should return array with one item and it calls to validationFn ' +
837+ 'when passing vm equals { test: { property: "test"} }, vmKeys equals ["test.property"] and validationFn equals function' , ( ) => {
838+ //Arrange
839+ const vm = {
840+ test : {
841+ property : 'test' ,
842+ } ,
843+ } ;
844+ const vmKeys = [ 'test.property' ] ;
845+ const validationFnSpy = sinon . spy ( ) ;
846+
847+ //Act
848+ const fieldValidationResultPromises = validationsDispatcher . fireAllFieldsValidations ( vm , vmKeys , validationFnSpy ) ;
849+
831850 //Ass
832851 expect ( fieldValidationResultPromises ) . to . have . length ( 1 ) ;
833852 expect ( validationFnSpy . called ) . to . be . true ;
@@ -957,7 +976,7 @@ describe('ValidationsDispatcher', () => {
957976 it ( 'Spec #9 => should return array with one item and it calls to validationFn' +
958977 'When passing vm equals function, validations equals array with one validationFn' , ( ) => {
959978 //Arrange
960- const vm = function ( ) {
979+ const vm = function ( ) {
961980 return "this is a function" ;
962981 } ;
963982 const validationFnSpy = sinon . spy ( ) ;
0 commit comments