@@ -526,6 +526,13 @@ describe('ObjectiveDialogComponent', () => {
526
526
expect ( component . objectiveForm . getRawValue ( ) . alignment ) . toEqual ( null ) ;
527
527
} ) ;
528
528
529
+ it ( 'should return team and objective with same text in alignment possibilities' , async ( ) => {
530
+ component . input . nativeElement . value = 'puzzle' ;
531
+ component . alignmentPossibilities$ = of ( [ alignmentPossibility1 , alignmentPossibility2 ] ) ;
532
+ component . filter ( ) ;
533
+ expect ( component . filteredOptions$ . getValue ( ) ) . toEqual ( [ alignmentPossibility1 , alignmentPossibility2 ] ) ;
534
+ } ) ;
535
+
529
536
it ( 'should load existing objective alignment to objectiveForm' , async ( ) => {
530
537
objectiveService . getAlignmentPossibilities . mockReturnValue ( of ( [ alignmentPossibility1 , alignmentPossibility2 ] ) ) ;
531
538
component . generateAlignmentPossibilities ( 3 , objectiveWithAlignment , null ) ;
@@ -577,14 +584,14 @@ describe('ObjectiveDialogComponent', () => {
577
584
expect ( component . filteredOptions$ . getValue ( ) ) . toEqual ( [ modifiedAlignmentPossibility ] ) ;
578
585
579
586
// Search for two objects
580
- component . input . nativeElement . value = 'we ' ;
587
+ component . input . nativeElement . value = 'buy ' ;
581
588
component . alignmentPossibilities$ = of ( [ alignmentPossibility1 , alignmentPossibility2 ] ) ;
582
589
component . filter ( ) ;
583
590
let modifiedAlignmentPossibilities = [
584
591
{
585
592
teamId : 1 ,
586
593
teamName : 'Puzzle ITC' ,
587
- alignmentObjectDtos : [ alignmentObject2 , alignmentObject3 ] ,
594
+ alignmentObjectDtos : [ alignmentObject3 ] ,
588
595
} ,
589
596
{
590
597
teamId : 2 ,
@@ -609,7 +616,7 @@ describe('ObjectiveDialogComponent', () => {
609
616
'objective' ,
610
617
) ;
611
618
expect ( alignmentObject ! . objectId ) . toEqual ( 1 ) ;
612
- expect ( alignmentObject ! . objectTitle ) . toEqual ( 'We want to increase the income' ) ;
619
+ expect ( alignmentObject ! . objectTitle ) . toEqual ( 'We want to increase the income puzzle buy ' ) ;
613
620
614
621
// keyResult
615
622
alignmentObject = component . findAlignmentObject ( [ alignmentPossibility1 , alignmentPossibility2 ] , 1 , 'keyResult' ) ;
0 commit comments