Skip to content

Commit f9fdff7

Browse files
author
Artem
committed
#RI-4935 fix UTests
1 parent 7998e52 commit f9fdff7

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

redisinsight/api/src/modules/cloud/database/cloud-database.analytics.spec.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ describe('CloudDatabaseAnalytics', () => {
7373
it('should emit error event with selected plan', async () => {
7474
await service.sendCloudFreeDatabaseFailed(
7575
httpException,
76-
{},
77-
cloudSubscriptionCapiService,
78-
mockData,
76+
{
77+
region: mockFreeCloudSubscriptionPlan1.region,
78+
provider: mockFreeCloudSubscriptionPlan1.provider,
79+
},
7980
);
8081

8182
expect(sendFailedEventMethod).toHaveBeenCalledWith(
@@ -93,26 +94,19 @@ describe('CloudDatabaseAnalytics', () => {
9394
await service.sendCloudFreeDatabaseFailed(
9495
httpException,
9596
undefined,
96-
cloudSubscriptionCapiService,
97-
mockData,
9897
);
9998

10099
expect(sendFailedEventMethod).toHaveBeenCalledWith(
101100
TelemetryEvents.CloudFreeDatabaseFailed,
102101
httpException,
103-
{
104-
region: mockFreeCloudSubscriptionPlan1.region,
105-
provider: mockFreeCloudSubscriptionPlan1.provider,
106-
},
102+
{},
107103
);
108104
});
109105

110106
it('should emit error event when free subscription is not exist', async () => {
111107
await service.sendCloudFreeDatabaseFailed(
112108
httpException,
113109
undefined,
114-
cloudSubscriptionCapiService,
115-
{ planId: 123, capiCredentials: mockCloudCapiAuthDto },
116110
);
117111

118112
expect(sendFailedEventMethod).toHaveBeenCalledWith(

redisinsight/api/src/modules/cloud/job/transformers/cloud-job-data.transformer.spec.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { TypeHelpOptions } from 'class-transformer';
22
import { CloudJobName } from 'src/modules/cloud/job/constants';
33
import { CreateDatabaseCloudJobDataDto } from 'src/modules/cloud/job/dto/create-database.cloud-job.data.dto';
44
import { cloudJobDataTransformer } from 'src/modules/cloud/job/transformers/cloud-job-data.transformer';
5+
import {
6+
CreateSubscriptionAndDatabaseCloudJobDataDto,
7+
} from 'src/modules/cloud/job/dto/create-subscription-and-database.cloud-job.data.dto';
8+
import { ImportDatabaseCloudJobDataDto } from 'src/modules/cloud/job/dto/import-database.cloud-job.data.dto';
59

610
describe('cloudJobDataTransformer', () => {
711
[
@@ -11,7 +15,15 @@ describe('cloudJobDataTransformer', () => {
1115
},
1216
{
1317
input: { object: { name: CloudJobName.CreateFreeSubscription } } as unknown as TypeHelpOptions,
14-
output: CreateDatabaseCloudJobDataDto,
18+
output: CreateSubscriptionAndDatabaseCloudJobDataDto,
19+
},
20+
{
21+
input: { object: { name: CloudJobName.CreateFreeSubscriptionAndDatabase } } as unknown as TypeHelpOptions,
22+
output: CreateSubscriptionAndDatabaseCloudJobDataDto,
23+
},
24+
{
25+
input: { object: { name: CloudJobName.ImportFreeDatabase } } as unknown as TypeHelpOptions,
26+
output: ImportDatabaseCloudJobDataDto,
1527
},
1628
{
1729
input: { object: { name: CloudJobName.WaitForActiveDatabase } } as unknown as TypeHelpOptions,

0 commit comments

Comments
 (0)