@memberjunction/actions-bizapps-lms 5.23.0 → 5.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.integration.example +4 -0
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +28 -0
- package/dist/base/base-lms.action.d.ts +5 -0
- package/dist/base/base-lms.action.d.ts.map +1 -1
- package/dist/base/base-lms.action.js +11 -4
- package/dist/base/base-lms.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/create-user.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/create-user.action.js +3 -0
- package/dist/providers/learnworlds/actions/create-user.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-course-details.action.js +6 -6
- package/dist/providers/learnworlds/actions/get-course-details.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-courses.action.d.ts +5 -0
- package/dist/providers/learnworlds/actions/get-courses.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-courses.action.js +73 -48
- package/dist/providers/learnworlds/actions/get-courses.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-details.action.d.ts +3 -3
- package/dist/providers/learnworlds/actions/get-user-details.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-details.action.js +23 -23
- package/dist/providers/learnworlds/actions/get-user-details.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-progress.action.d.ts +4 -1
- package/dist/providers/learnworlds/actions/get-user-progress.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-user-progress.action.js +48 -37
- package/dist/providers/learnworlds/actions/get-user-progress.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/get-users.action.d.ts +3 -0
- package/dist/providers/learnworlds/actions/get-users.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/actions/get-users.action.js +21 -15
- package/dist/providers/learnworlds/actions/get-users.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/onboard-learner.action.js +4 -4
- package/dist/providers/learnworlds/actions/onboard-learner.action.js.map +1 -1
- package/dist/providers/learnworlds/actions/update-user-progress.action.js +2 -2
- package/dist/providers/learnworlds/actions/update-user-progress.action.js.map +1 -1
- package/dist/providers/learnworlds/learnworlds-base.action.d.ts +44 -0
- package/dist/providers/learnworlds/learnworlds-base.action.d.ts.map +1 -1
- package/dist/providers/learnworlds/learnworlds-base.action.js +107 -2
- package/dist/providers/learnworlds/learnworlds-base.action.js.map +1 -1
- package/package.json +6 -6
- package/src/__tests__/get-certificates.action.test.ts +467 -0
- package/src/__tests__/get-course-analytics.action.test.ts +340 -0
- package/src/__tests__/get-course-details.action.test.ts +510 -0
- package/src/__tests__/get-courses.action.test.ts +1191 -0
- package/src/__tests__/get-quiz-results.action.test.ts +575 -0
- package/src/__tests__/get-user-details.action.test.ts +533 -0
- package/src/__tests__/get-user-enrollments.action.test.ts +387 -0
- package/src/__tests__/get-user-progress.action.test.ts +588 -0
- package/src/__tests__/get-users.action.test.ts +464 -0
- package/src/__tests__/integration.test.ts +252 -3
- package/src/__tests__/rate-limit-retry.test.ts +296 -0
- package/src/__tests__/update-user-progress.action.test.ts +312 -0
- package/src/base/base-lms.action.ts +12 -4
- package/src/providers/learnworlds/actions/create-user.action.ts +4 -0
- package/src/providers/learnworlds/actions/get-course-details.action.ts +6 -6
- package/src/providers/learnworlds/actions/get-courses.action.ts +78 -58
- package/src/providers/learnworlds/actions/get-user-details.action.ts +32 -25
- package/src/providers/learnworlds/actions/get-user-progress.action.ts +54 -41
- package/src/providers/learnworlds/actions/get-users.action.ts +24 -16
- package/src/providers/learnworlds/actions/onboard-learner.action.ts +4 -4
- package/src/providers/learnworlds/actions/update-user-progress.action.ts +2 -2
- package/src/providers/learnworlds/learnworlds-base.action.ts +128 -2
- package/tsconfig.json +2 -1
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
+
|
|
3
|
+
// Mock dependencies (same pattern as get-bundles.action.test.ts)
|
|
4
|
+
vi.mock('@memberjunction/actions', () => ({
|
|
5
|
+
BaseAction: class BaseAction {
|
|
6
|
+
protected async InternalRunAction(): Promise<unknown> {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
vi.mock('@memberjunction/global', () => ({
|
|
13
|
+
RegisterClass: () => (target: unknown) => target,
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
vi.mock('@memberjunction/core', () => ({
|
|
17
|
+
UserInfo: class UserInfo {},
|
|
18
|
+
Metadata: vi.fn(),
|
|
19
|
+
RunView: vi.fn().mockImplementation(() => ({
|
|
20
|
+
RunView: vi.fn().mockResolvedValue({ Success: true, Results: [] }),
|
|
21
|
+
})),
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
vi.mock('@memberjunction/core-entities', () => ({
|
|
25
|
+
MJCompanyIntegrationEntity: class MJCompanyIntegrationEntity {
|
|
26
|
+
CompanyID: string = '';
|
|
27
|
+
APIKey: string | null = null;
|
|
28
|
+
AccessToken: string | null = null;
|
|
29
|
+
ExternalSystemID: string | null = null;
|
|
30
|
+
CustomAttribute1: string | null = null;
|
|
31
|
+
},
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
vi.mock('@memberjunction/actions-base', () => ({
|
|
35
|
+
ActionParam: class ActionParam {
|
|
36
|
+
Name: string = '';
|
|
37
|
+
Value: unknown = null;
|
|
38
|
+
Type: string = 'Input';
|
|
39
|
+
},
|
|
40
|
+
}));
|
|
41
|
+
|
|
42
|
+
import { UserInfo } from '@memberjunction/core';
|
|
43
|
+
import { GetCourseAnalyticsAction } from '../providers/learnworlds/actions/get-course-analytics.action';
|
|
44
|
+
import { ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Helper to create a mock UserInfo for test context
|
|
48
|
+
*/
|
|
49
|
+
function createMockContextUser(): UserInfo {
|
|
50
|
+
return { ID: 'test-user-id', Name: 'Test User', Email: 'test@example.com' } as unknown as UserInfo;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Creates a raw LW analytics API response with all data populated
|
|
55
|
+
*/
|
|
56
|
+
function createFullAnalyticsApiResponse(overrides: Record<string, unknown> = {}): Record<string, unknown> {
|
|
57
|
+
return {
|
|
58
|
+
success: true,
|
|
59
|
+
data: {
|
|
60
|
+
total_enrollments: 500,
|
|
61
|
+
new_enrollments: 50,
|
|
62
|
+
active_students: 200,
|
|
63
|
+
enrollment_trend: [
|
|
64
|
+
{ date: '2024-01-01', value: 10 },
|
|
65
|
+
{ date: '2024-01-02', value: 15 },
|
|
66
|
+
],
|
|
67
|
+
average_progress: 65.5,
|
|
68
|
+
completion_rate: 42.0,
|
|
69
|
+
total_completions: 210,
|
|
70
|
+
in_progress_count: 180,
|
|
71
|
+
not_started_count: 110,
|
|
72
|
+
dropout_rate: 8.5,
|
|
73
|
+
average_time_spent: 3600,
|
|
74
|
+
total_time_spent: 1800000,
|
|
75
|
+
average_session_duration: 1200,
|
|
76
|
+
last_activity_date: '2024-06-20T12:00:00Z',
|
|
77
|
+
daily_active_users: [
|
|
78
|
+
{ date: '2024-06-19', value: 30 },
|
|
79
|
+
{ date: '2024-06-20', value: 25 },
|
|
80
|
+
],
|
|
81
|
+
average_quiz_score: 78.3,
|
|
82
|
+
pass_rate: 85.0,
|
|
83
|
+
certificates_issued: 190,
|
|
84
|
+
average_time_to_complete: 7200,
|
|
85
|
+
...overrides,
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Creates a raw LW revenue API response
|
|
92
|
+
*/
|
|
93
|
+
function createRevenueApiResponse(): Record<string, unknown> {
|
|
94
|
+
return {
|
|
95
|
+
success: true,
|
|
96
|
+
data: {
|
|
97
|
+
total_revenue: 25000,
|
|
98
|
+
currency: 'USD',
|
|
99
|
+
average_order_value: 50,
|
|
100
|
+
total_orders: 500,
|
|
101
|
+
revenue_trend: [{ date: '2024-01-01', value: 1000 }],
|
|
102
|
+
top_markets: [{ label: 'US', value: 15000 }],
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Creates a raw LW module stats API response
|
|
109
|
+
*/
|
|
110
|
+
function createModuleStatsApiResponse(): Record<string, unknown> {
|
|
111
|
+
return {
|
|
112
|
+
success: true,
|
|
113
|
+
data: [
|
|
114
|
+
{
|
|
115
|
+
id: 'mod-1',
|
|
116
|
+
title: 'Module 1',
|
|
117
|
+
completion_rate: 80,
|
|
118
|
+
average_progress: 75,
|
|
119
|
+
average_time_spent: 600,
|
|
120
|
+
students_started: 100,
|
|
121
|
+
students_completed: 80,
|
|
122
|
+
lessons: [
|
|
123
|
+
{
|
|
124
|
+
id: 'lesson-1',
|
|
125
|
+
title: 'Lesson 1',
|
|
126
|
+
completion_rate: 90,
|
|
127
|
+
average_time_spent: 300,
|
|
128
|
+
view_count: 150,
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Creates a raw LW enrollments API response for user breakdown
|
|
138
|
+
*/
|
|
139
|
+
function createEnrollmentsApiResponse(progressValues: number[]): Record<string, unknown> {
|
|
140
|
+
return {
|
|
141
|
+
success: true,
|
|
142
|
+
data: progressValues.map((p) => ({ progress_percentage: p })),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
describe('GetCourseAnalyticsAction', () => {
|
|
147
|
+
let action: GetCourseAnalyticsAction;
|
|
148
|
+
let contextUser: UserInfo;
|
|
149
|
+
|
|
150
|
+
beforeEach(() => {
|
|
151
|
+
action = new GetCourseAnalyticsAction();
|
|
152
|
+
contextUser = createMockContextUser();
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
describe('GetCourseAnalytics() typed method', () => {
|
|
156
|
+
it('should return analytics with all data', async () => {
|
|
157
|
+
const analyticsResponse = createFullAnalyticsApiResponse();
|
|
158
|
+
const revenueResponse = createRevenueApiResponse();
|
|
159
|
+
const moduleStatsResponse = createModuleStatsApiResponse();
|
|
160
|
+
|
|
161
|
+
vi.spyOn(action as never, 'makeLearnWorldsRequest')
|
|
162
|
+
.mockResolvedValueOnce(analyticsResponse as never) // core analytics
|
|
163
|
+
.mockResolvedValueOnce(revenueResponse as never) // revenue
|
|
164
|
+
.mockResolvedValueOnce(moduleStatsResponse as never); // module stats
|
|
165
|
+
|
|
166
|
+
const result = await action.GetCourseAnalytics(
|
|
167
|
+
{ CompanyID: 'comp-1', CourseID: 'course-1', IncludeRevenue: true, IncludeModuleStats: true },
|
|
168
|
+
contextUser,
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
// Verify core analytics
|
|
172
|
+
expect(result.CourseAnalytics.courseId).toBe('course-1');
|
|
173
|
+
expect(result.CourseAnalytics.enrollment.totalEnrollments).toBe(500);
|
|
174
|
+
expect(result.CourseAnalytics.enrollment.newEnrollments).toBe(50);
|
|
175
|
+
expect(result.CourseAnalytics.enrollment.activeStudents).toBe(200);
|
|
176
|
+
expect(result.CourseAnalytics.progress.averageProgressPercentage).toBe(65.5);
|
|
177
|
+
expect(result.CourseAnalytics.progress.completionRate).toBe(42.0);
|
|
178
|
+
expect(result.CourseAnalytics.progress.totalCompletions).toBe(210);
|
|
179
|
+
expect(result.CourseAnalytics.engagement.averageTimeSpent).toBe(3600);
|
|
180
|
+
expect(result.CourseAnalytics.performance.averageQuizScore).toBe(78.3);
|
|
181
|
+
expect(result.CourseAnalytics.performance.certificatesIssued).toBe(190);
|
|
182
|
+
|
|
183
|
+
// Verify revenue
|
|
184
|
+
expect(result.CourseAnalytics.revenue).toBeDefined();
|
|
185
|
+
expect(result.CourseAnalytics.revenue!.totalRevenue).toBe(25000);
|
|
186
|
+
expect(result.CourseAnalytics.revenue!.currency).toBe('USD');
|
|
187
|
+
expect(result.CourseAnalytics.revenue!.totalOrders).toBe(500);
|
|
188
|
+
|
|
189
|
+
// Verify module stats
|
|
190
|
+
expect(result.CourseAnalytics.moduleStats).toBeDefined();
|
|
191
|
+
expect(result.CourseAnalytics.moduleStats).toHaveLength(1);
|
|
192
|
+
expect(result.CourseAnalytics.moduleStats![0].moduleId).toBe('mod-1');
|
|
193
|
+
expect(result.CourseAnalytics.moduleStats![0].moduleTitle).toBe('Module 1');
|
|
194
|
+
expect(result.CourseAnalytics.moduleStats![0].lessons).toHaveLength(1);
|
|
195
|
+
|
|
196
|
+
// Verify summary
|
|
197
|
+
expect(result.Summary.courseId).toBe('course-1');
|
|
198
|
+
expect(result.Summary.keyMetrics.totalEnrollments).toBe(500);
|
|
199
|
+
expect(result.Summary.keyMetrics.completionRate).toBe(42.0);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
it('should return analytics with only base data (no revenue or module breakdown)', async () => {
|
|
203
|
+
const analyticsResponse = createFullAnalyticsApiResponse();
|
|
204
|
+
|
|
205
|
+
vi.spyOn(action as never, 'makeLearnWorldsRequest').mockResolvedValueOnce(analyticsResponse as never);
|
|
206
|
+
|
|
207
|
+
const result = await action.GetCourseAnalytics(
|
|
208
|
+
{ CompanyID: 'comp-1', CourseID: 'course-1', IncludeRevenue: false, IncludeModuleStats: false },
|
|
209
|
+
contextUser,
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
expect(result.CourseAnalytics.courseId).toBe('course-1');
|
|
213
|
+
expect(result.CourseAnalytics.enrollment.totalEnrollments).toBe(500);
|
|
214
|
+
expect(result.CourseAnalytics.revenue).toBeUndefined();
|
|
215
|
+
expect(result.CourseAnalytics.moduleStats).toBeUndefined();
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
it('should throw error when CourseID is missing', async () => {
|
|
219
|
+
await expect(
|
|
220
|
+
action.GetCourseAnalytics({ CompanyID: 'comp-1', CourseID: '' }, contextUser),
|
|
221
|
+
).rejects.toThrow('CourseID is required');
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it('should handle empty enrollment data in user breakdown', async () => {
|
|
225
|
+
const analyticsResponse = createFullAnalyticsApiResponse();
|
|
226
|
+
const enrollmentsResponse = createEnrollmentsApiResponse([]);
|
|
227
|
+
|
|
228
|
+
vi.spyOn(action as never, 'makeLearnWorldsRequest')
|
|
229
|
+
.mockResolvedValueOnce(analyticsResponse as never) // core analytics
|
|
230
|
+
.mockResolvedValueOnce(enrollmentsResponse as never); // enrollments (for user breakdown)
|
|
231
|
+
|
|
232
|
+
const result = await action.GetCourseAnalytics(
|
|
233
|
+
{
|
|
234
|
+
CompanyID: 'comp-1',
|
|
235
|
+
CourseID: 'course-1',
|
|
236
|
+
IncludeUserBreakdown: true,
|
|
237
|
+
IncludeRevenue: false,
|
|
238
|
+
IncludeModuleStats: false,
|
|
239
|
+
},
|
|
240
|
+
contextUser,
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
expect(result.CourseAnalytics.userBreakdown).toBeDefined();
|
|
244
|
+
expect(result.CourseAnalytics.userBreakdown!.total).toBe(0);
|
|
245
|
+
expect(result.CourseAnalytics.userBreakdown!.percentageDistribution.notStarted).toBe('0.0');
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
it('should propagate errors from makeLearnWorldsRequest', async () => {
|
|
249
|
+
vi.spyOn(action as never, 'makeLearnWorldsRequest').mockRejectedValue(new Error('Network error'));
|
|
250
|
+
|
|
251
|
+
await expect(
|
|
252
|
+
action.GetCourseAnalytics({ CompanyID: 'comp-1', CourseID: 'course-1' }, contextUser),
|
|
253
|
+
).rejects.toThrow('Network error');
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it('should compute user breakdown buckets correctly', async () => {
|
|
257
|
+
const analyticsResponse = createFullAnalyticsApiResponse();
|
|
258
|
+
// progress values: 0, 10, 30, 60, 80, 100
|
|
259
|
+
const enrollmentsResponse = createEnrollmentsApiResponse([0, 10, 30, 60, 80, 100]);
|
|
260
|
+
|
|
261
|
+
vi.spyOn(action as never, 'makeLearnWorldsRequest')
|
|
262
|
+
.mockResolvedValueOnce(analyticsResponse as never)
|
|
263
|
+
.mockResolvedValueOnce(enrollmentsResponse as never);
|
|
264
|
+
|
|
265
|
+
const result = await action.GetCourseAnalytics(
|
|
266
|
+
{
|
|
267
|
+
CompanyID: 'comp-1',
|
|
268
|
+
CourseID: 'course-1',
|
|
269
|
+
IncludeUserBreakdown: true,
|
|
270
|
+
IncludeRevenue: false,
|
|
271
|
+
IncludeModuleStats: false,
|
|
272
|
+
},
|
|
273
|
+
contextUser,
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
const breakdown = result.CourseAnalytics.userBreakdown!;
|
|
277
|
+
expect(breakdown.total).toBe(6);
|
|
278
|
+
expect(breakdown.progressDistribution.notStarted).toBe(1);
|
|
279
|
+
expect(breakdown.progressDistribution.under25).toBe(1);
|
|
280
|
+
expect(breakdown.progressDistribution.between25And50).toBe(1);
|
|
281
|
+
expect(breakdown.progressDistribution.between50And75).toBe(1);
|
|
282
|
+
expect(breakdown.progressDistribution.between75And99).toBe(1);
|
|
283
|
+
expect(breakdown.progressDistribution.completed).toBe(1);
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
describe('InternalRunAction()', () => {
|
|
288
|
+
it('should return success when GetCourseAnalytics succeeds', async () => {
|
|
289
|
+
vi.spyOn(action, 'GetCourseAnalytics').mockResolvedValue({
|
|
290
|
+
CourseAnalytics: {
|
|
291
|
+
courseId: 'course-1',
|
|
292
|
+
period: { from: 'all-time', to: 'current' },
|
|
293
|
+
enrollment: { totalEnrollments: 100, newEnrollments: 10, activeStudents: 50, enrollmentTrend: [] },
|
|
294
|
+
progress: { averageProgressPercentage: 60, completionRate: 40, totalCompletions: 40, inProgressCount: 30, notStartedCount: 30, dropoutRate: 5 },
|
|
295
|
+
engagement: { averageTimeSpent: 1800, averageTimeSpentText: '30m 0s', totalTimeSpent: 180000, totalTimeSpentText: '50h 0m 0s', averageSessionDuration: 600, dailyActiveUsers: [] },
|
|
296
|
+
performance: { averageQuizScore: 75, passRate: 80, certificatesIssued: 35, averageTimeToComplete: 3600, averageTimeToCompleteText: '1h 0m 0s' },
|
|
297
|
+
},
|
|
298
|
+
Summary: {
|
|
299
|
+
courseId: 'course-1',
|
|
300
|
+
period: { from: 'all-time', to: 'current' },
|
|
301
|
+
keyMetrics: { totalEnrollments: 100, completionRate: 40, averageProgress: 60, activeStudents: 50, averageTimeSpent: '30m 0s', certificatesIssued: 35 },
|
|
302
|
+
trends: { enrollmentGrowth: 'stable', engagementTrend: 'stable', completionTrend: 'stable' },
|
|
303
|
+
},
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
const runParams: RunActionParams = {
|
|
307
|
+
Params: [
|
|
308
|
+
{ Name: 'CompanyID', Type: 'Input', Value: 'comp-1' },
|
|
309
|
+
{ Name: 'CourseID', Type: 'Input', Value: 'course-1' },
|
|
310
|
+
],
|
|
311
|
+
ContextUser: contextUser,
|
|
312
|
+
} as unknown as RunActionParams;
|
|
313
|
+
|
|
314
|
+
const result = (await action['InternalRunAction'](runParams)) as ActionResultSimple;
|
|
315
|
+
|
|
316
|
+
expect(result.Success).toBe(true);
|
|
317
|
+
expect(result.ResultCode).toBe('SUCCESS');
|
|
318
|
+
expect(result.Message).toContain('Course analytics retrieved successfully');
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
it('should return error result when GetCourseAnalytics throws', async () => {
|
|
322
|
+
vi.spyOn(action, 'GetCourseAnalytics').mockRejectedValue(new Error('Analytics API unavailable'));
|
|
323
|
+
|
|
324
|
+
const runParams: RunActionParams = {
|
|
325
|
+
Params: [
|
|
326
|
+
{ Name: 'CompanyID', Type: 'Input', Value: 'comp-1' },
|
|
327
|
+
{ Name: 'CourseID', Type: 'Input', Value: 'course-1' },
|
|
328
|
+
],
|
|
329
|
+
ContextUser: contextUser,
|
|
330
|
+
} as unknown as RunActionParams;
|
|
331
|
+
|
|
332
|
+
const result = (await action['InternalRunAction'](runParams)) as ActionResultSimple;
|
|
333
|
+
|
|
334
|
+
expect(result.Success).toBe(false);
|
|
335
|
+
expect(result.ResultCode).toBe('ERROR');
|
|
336
|
+
expect(result.Message).toContain('Error retrieving course analytics');
|
|
337
|
+
expect(result.Message).toContain('Analytics API unavailable');
|
|
338
|
+
});
|
|
339
|
+
});
|
|
340
|
+
});
|