@@ -20,7 +20,8 @@ import {
2020 selectSupervisorHierarchyIds ,
2121 selectSubordinates ,
2222 selectIsSubordinateOfCurrentUser ,
23- selectHasReportPermission
23+ selectHasReportPermission ,
24+ selectActiveOrInactiveProfile
2425} from './selectors' ;
2526
2627describe ( 'Selectors' , ( ) => {
@@ -1525,4 +1526,76 @@ describe('Selectors', () => {
15251526
15261527 expect ( selectHasReportPermission ( testState ) ) . toBe ( false ) ;
15271528 } ) ;
1529+
1530+ it ( 'selectActiveOrInactiveProfile should a profile if active or inactive' , ( ) => {
1531+ const activeTestMember = {
1532+ id : 1 ,
1533+ bioText : 'foo' ,
1534+ employeeId : 11 ,
1535+ name : 'A Person' ,
1536+ firstName : 'A' ,
1537+ lastName : 'PersonA' ,
1538+ location : 'St Louis' ,
1539+ title : 'engineer' ,
1540+ 1541+ pdlId : 9 ,
1542+ startDate : [ 2012 , 9 , 29 ] ,
1543+ } ;
1544+ const inactiveTestMember = {
1545+ id : 2 ,
1546+ bioText : 'foo' ,
1547+ employeeId : 12 ,
1548+ name : 'B Person' ,
1549+ firstName : 'B' ,
1550+ lastName : 'PersonB' ,
1551+ location : 'St Louis' ,
1552+ title : 'engineer' ,
1553+ 1554+ pdlId : 9 ,
1555+ startDate : [ 2012 , 9 , 29 ] ,
1556+ terminationDate : [ 2013 , 9 , 29 ] ,
1557+ } ;
1558+ /** @type MemberProfile[] */
1559+ const testActiveMemberProfiles = [
1560+ activeTestMember ,
1561+ {
1562+ id : 3 ,
1563+ bioText : 'foo' ,
1564+ employeeId : 13 ,
1565+ name : 'C Person' ,
1566+ firstName : 'C' ,
1567+ lastName : 'PersonC' ,
1568+ location : 'St Louis' ,
1569+ title : 'engineer' ,
1570+ 1571+ pdlId : 9 ,
1572+ startDate : [ 2012 , 9 , 29 ] ,
1573+ }
1574+ ] ;
1575+ /** @type MemberProfile[] */
1576+ const testInactiveMemberProfiles = [
1577+ inactiveTestMember ,
1578+ {
1579+ id : 4 ,
1580+ bioText : 'foo' ,
1581+ employeeId : 13 ,
1582+ name : 'D Person' ,
1583+ firstName : 'D' ,
1584+ lastName : 'PersonD' ,
1585+ location : 'St Louis' ,
1586+ title : 'engineer' ,
1587+ 1588+ pdlId : 9 ,
1589+ startDate : [ 2012 , 9 , 29 ] ,
1590+ terminationDate : [ 2013 , 9 , 29 ] ,
1591+ }
1592+ ] ;
1593+ const testState = {
1594+ memberProfiles : testActiveMemberProfiles ,
1595+ terminatedMembers : testInactiveMemberProfiles ,
1596+ } ;
1597+
1598+ expect ( selectActiveOrInactiveProfile ( testState , activeTestMember . id ) ) . toEqual ( activeTestMember ) ;
1599+ expect ( selectActiveOrInactiveProfile ( testState , inactiveTestMember . id ) ) . toEqual ( inactiveTestMember ) ;
1600+ } ) ;
15281601} ) ;
0 commit comments