1
1
@isTest
2
2
public class IPS_ParticipantPortalReportContTest {
3
3
4
+
4
5
@TestSetup
5
6
static void makeData () {
6
7
Person__c participant = IPS_TestDataFactory .createPerson ();
@@ -29,7 +30,17 @@ public class IPS_ParticipantPortalReportContTest {
29
30
30
31
Task taskDeactive = IPS_TestDataFactory .createPassiveDeactivateGoal (jobbspor .Id );
31
32
insert taskDeactive ;
32
-
33
+
34
+
35
+ Task participantGoalsOpen = IPS_TestDataFactory .creategoal (jobbspor .Id );
36
+ insert participantGoalsOpen ;
37
+
38
+ Task participantGoalsCompleted = IPS_TestDataFactory .creategoal (jobbspor .Id );
39
+ participantGoalsCompleted .ips_Due_Date_Time__c = System .today ().addDays (- 7 );
40
+ participantGoalsCompleted .ActivityDate = System .today ().addDays (- 7 );
41
+ participantGoalsCompleted .Status = ' Completed' ;
42
+ insert participantGoalsCompleted ;
43
+
33
44
Event participantMeetingCompleted = IPS_TestDataFactory .createParticipantEvent (contactId , jobbspor .Id );
34
45
insert participantMeetingCompleted ;
35
46
@@ -42,6 +53,25 @@ public class IPS_ParticipantPortalReportContTest {
42
53
participantMeetingAbsent .IPS_Status1__c = ' Participant Absent' ;
43
54
update participantMeetingAbsent ;
44
55
56
+
57
+
58
+ Event employerMeetingCompletedIPS = IPS_TestDataFactory .createEmployerEventWithParticipant (
59
+ businessAccount .id ,
60
+ userId .id ,
61
+ jobbspor .id
62
+ );
63
+ employerMeetingCompletedIPS .IPS_Status1__c = ' Completed' ;
64
+ insert employerMeetingCompletedIPS ;
65
+
66
+ Event employerMeetingAbsentIPS = IPS_TestDataFactory .createEmployerEventWithParticipant (
67
+ businessAccount .id ,
68
+ userId .id ,
69
+ jobbspor .id
70
+ );
71
+ employerMeetingAbsentIPS .IPS_Status1__c = ' Participant Absent' ;
72
+ insert employerMeetingAbsentIPS ;
73
+
74
+
45
75
ips_job__c jobOngoingIPS = IPS_TestDataFactory .createJob (businessAccount .id , jobbspor .id , ' Ongoing' );
46
76
insert jobOngoingIPS ;
47
77
@@ -52,21 +82,16 @@ public class IPS_ParticipantPortalReportContTest {
52
82
insert eduOngoingIPS ;
53
83
54
84
ips_Education__c eduPlannedIPS = IPS_TestDataFactory .createEducation (jobbspor .id );
55
- insert eduPlannedIPS ;
56
-
57
85
eduPlannedIPS .ips_Status__c = ' Planned' ;
58
86
eduPlannedIPS .ips_Start_Date__c = System .today ().addDays (7 );
59
- update eduPlannedIPS ;
87
+ insert eduPlannedIPS ;
60
88
61
89
ips_Education__c eduCompletedIPS = IPS_TestDataFactory .createEducation (jobbspor .id );
62
- insert eduCompletedIPS ;
63
-
64
90
eduCompletedIPS .ips_Status__c = ' Completed' ;
65
91
eduCompletedIPS .ips_Start_Date__c = System .today ().addDays (- 7 );
66
92
eduCompletedIPS .ips_End_Date__c = System .today ().addDays (30 );
67
- update eduCompletedIPS ;
68
-
69
-
93
+ insert eduCompletedIPS ;
94
+
70
95
/** *** AMS *****/
71
96
Work_Trail__c jobbsporAMS = IPS_TestDataFactory .createUOJobbspor (participantId );
72
97
insert jobbsporAMS ;
@@ -75,35 +100,29 @@ public class IPS_ParticipantPortalReportContTest {
75
100
insert eduOngoingAMS ;
76
101
77
102
AMS_Vocational_education_and_training__c eduPlannedAMS = IPS_TestDataFactory .createEducationAMS (jobbsporAMS .id );
78
- insert eduPlannedAMS ;
79
-
80
103
eduPlannedAMS .AMS_Status__c = ' Planned' ;
81
104
eduPlannedAMS .AMS_Start_Date__c = System .today ().addDays (7 );
82
105
eduPlannedAMS .AMS_End_Date__c = System .today ().addDays (30 );
83
- update eduPlannedAMS ;
106
+ insert eduPlannedAMS ;
84
107
85
108
AMS_Vocational_education_and_training__c eduCompletedAMS = IPS_TestDataFactory .createEducationAMS (
86
109
jobbsporAMS .id
87
110
);
88
- insert eduCompletedAMS ;
89
-
90
111
eduCompletedAMS .AMS_Status__c = ' Completed' ;
91
112
eduCompletedAMS .AMS_Start_Date__c = System .today ().addDays (- 7 );
92
113
eduCompletedAMS .AMS_End_Date__c = System .today ();
93
- update eduCompletedAMS ;
94
-
95
-
114
+ insert eduCompletedAMS ;
115
+
96
116
}
97
117
98
118
@isTest
99
119
static void getReportPortalIPS () {
100
120
ID workTrailId = [SELECT id FROM Work_Trail__c WHERE RecordType.developername = ' IPS' LIMIT 1 ]?. id ;
101
121
102
122
ips_report__c intervallReport = IPS_TestDataFactory .createIntervallReport (workTrailId );
103
- insert intervallReport ;
104
123
intervallReport .IPS_worktrail_Type__c = ' IPS' ;
105
124
intervallReport .IPS_status__c = ' Shared report' ;
106
- update intervallReport ;
125
+ insert intervallReport ;
107
126
108
127
List <IPS_ParticipantPortalReport > listReport = IPS_ParticipantPortalReportController .getParticipantReport (workTrailId ,' TRAIL' );
109
128
}
@@ -113,10 +132,9 @@ public class IPS_ParticipantPortalReportContTest {
113
132
ID workTrailId = [SELECT id FROM Work_Trail__c WHERE RecordType.developername = ' ips_Supported_Employment' LIMIT 1 ]?. id ;
114
133
115
134
ips_report__c intervallReport = IPS_TestDataFactory .createIntervallReport (workTrailId );
116
- insert intervallReport ;
117
135
intervallReport .IPS_worktrail_Type__c = ' Supported Employment' ;
118
136
intervallReport .IPS_status__c = ' Shared report' ;
119
- update intervallReport ;
137
+ insert intervallReport ;
120
138
121
139
List <IPS_ParticipantPortalReport > listReport = IPS_ParticipantPortalReportController .getParticipantReport (workTrailId ,' TRAIL' );
122
140
}
@@ -126,21 +144,21 @@ public class IPS_ParticipantPortalReportContTest {
126
144
ID workTrailId = [SELECT id FROM Work_Trail__c WHERE RecordType.developername = ' IPS' LIMIT 1 ]?. id ;
127
145
128
146
ips_report__c intervallReport = IPS_TestDataFactory .createIntervallReport (workTrailId );
129
- insert intervallReport ;
130
147
intervallReport .IPS_status__c = ' Shared report' ;
131
- update intervallReport ;
148
+ insert intervallReport ;
132
149
133
150
List <IPS_ParticipantPortalReport > listReport = IPS_ParticipantPortalReportController .getParticipantReport (intervallReport .id ,' REPORT' );
134
151
}
135
152
153
+
154
+
136
155
@isTest
137
156
static void intervallReport (){
138
157
ID workTrailId = [SELECT id FROM Work_Trail__c WHERE RecordType.developername = ' IPS' LIMIT 1 ]?. id ;
139
158
140
159
ips_report__c intervallReport = IPS_TestDataFactory .createIntervallReport (workTrailId );
141
- insert intervallReport ;
142
160
intervallReport .IPS_status__c = ' Shared report' ;
143
- update intervallReport ;
161
+ insert intervallReport ;
144
162
145
163
List <IPS_ParticipantPortalTask > goal = IPS_ParticipantPortalReportController .getParticipantsReportCompletedGoals (intervallReport .id ,' Intervall' ,intervallReport .IPS_intervallDateFrom__c ,intervallReport .IPS_intervallDateTo__c );
146
164
List <IPS_ParticipantPortalTask > openGoal = IPS_ParticipantPortalReportController .getParticipantsReportOpenGoals (intervallReport .id , ' Intervall' , intervallReport .IPS_intervallDateTo__c );
@@ -158,20 +176,16 @@ public class IPS_ParticipantPortalReportContTest {
158
176
ID workTrailId = [SELECT id FROM Work_Trail__c WHERE RecordType.developername = ' IPS' LIMIT 1 ]?. id ;
159
177
160
178
ips_report__c endReport = IPS_TestDataFactory .createEndReport (workTrailId );
161
- insert endReport ;
162
179
endReport .IPS_status__c = ' Shared report' ;
163
- update endReport ;
180
+ insert endReport ;
164
181
165
182
List <IPS_ParticipantPortalTask > goal = IPS_ParticipantPortalReportController .getParticipantsReportCompletedGoals (endReport .id ,' End report' ,null ,null );
166
183
List <IPS_ParticipantPortalEvent > meeting = IPS_ParticipantPortalReportController .getParticipantsReportCompletedMeetings (endReport .id ,' End report' ,null ,null );
167
184
List <IPS_ParticipantPortalEvent > absent = IPS_ParticipantPortalReportController .getParticipantsReportAbsentMeetings (endReport .id ,' End report' ,null ,null );
168
185
List <IPS_ParticipantPortalEvent > cancelled = IPS_ParticipantPortalReportController .getParticipantReportCancelledMeetings (endReport .id ,' End report' ,null ,null );
169
- /*
170
- List<IPS_ParticipantPortalEvent> employee = IPS_ParticipantPortalReportController.getParticipantsReportEmployeeCompletedMeetings(intervallReport.id,'Intervall',intervallReport.IPS_intervallDateFrom__c,intervallReport.IPS_intervallDateTo__c);
171
- List<IPS_ParticipantPortalEvent> openmeeting = IPS_ParticipantPortalReportController.getParticipantsReportOpenMeetings(intervallReport.id,'Intervall',intervallReport.IPS_intervallDateTo__c);
172
- List<IPS_ParticipantPortalJob> jobs = IPS_ParticipantPortalReportController.getParticipantJobs(workTrailId,intervallReport.IPS_intervallDateFrom__c,intervallReport.IPS_intervallDateTo__c);
173
- List<ips_ParticipantPortalEducation> edu = IPS_ParticipantPortalReportController.getParticipantEducations(workTrailId,'Intervall',intervallReport.IPS_intervallDateFrom__c,intervallReport.IPS_intervallDateTo__c);
174
- */
186
+ List <IPS_ParticipantPortalEvent > employee = IPS_ParticipantPortalReportController .getParticipantsReportEmployeeCompletedMeetings (endReport .id ,' End report' ,null ,null );
187
+ // List<IPS_ParticipantPortalJob> jobs = IPS_ParticipantPortalReportController.getParticipantJobs(endReport.id,'End report',null,null);
188
+ List <ips_ParticipantPortalEducation > edu = IPS_ParticipantPortalReportController .getParticipantEducations (endReport .id ,' End report' ,null ,null );
175
189
}
176
190
177
191
@isTest
0 commit comments