Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Imunal committed Nov 25, 2024
1 parent a80299a commit 43ec6f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/services/antigro-http-client.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('AntigroHttpClientService', () => {

//
await expect(() => client.getClientDesign('123-123')).rejects.toThrow(
`getClientDesign request failed: Network error`,
`Network error in getClientDesign: Network error`,
);
});

Expand All @@ -55,7 +55,7 @@ describe('AntigroHttpClientService', () => {

//
await expect(() => client.getClientDesign('123-123')).rejects.toThrow(
`getClientDesign request failed: Network error`,
`Network error in getClientDesign: Network error`,
);
});

Expand All @@ -73,7 +73,7 @@ describe('AntigroHttpClientService', () => {

//@ts-expect-error
await expect(() => client.getClientDesign(payload)).rejects.toThrow(
`Schema validation errored in getClientDesign:`,
`Validation error in getClientDesign:`,
);
});
});
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('AntigroHttpClientService', () => {

//
await expect(() => client.createClientDesign(payload)).rejects.toThrow(
`createClientDesign request failed: Network error`,
`Network error in createClientDesign: Network error`,
);
});

Expand All @@ -150,7 +150,7 @@ describe('AntigroHttpClientService', () => {

//
await expect(() => client.createClientDesign(payload)).rejects.toThrow(
`createClientDesign request failed: Network error`,
`Network error in createClientDesign: Network error`,
);
});

Expand All @@ -170,7 +170,7 @@ describe('AntigroHttpClientService', () => {

//@ts-expect-error
await expect(() => client.createClientDesign(payload)).rejects.toThrow(
`Schema validation errored in createClientDesign:`,
`Validation error in createClientDesign:`,
);
});
});
Expand Down Expand Up @@ -218,7 +218,7 @@ describe('AntigroHttpClientService', () => {

//
await expect(() => client.updateClientDesign(payload)).rejects.toThrow(
`updateClientDesign request failed: Network error`,
`Network error in updateClientDesign: Network error`,
);
});

Expand All @@ -238,7 +238,7 @@ describe('AntigroHttpClientService', () => {

//
await expect(() => client.updateClientDesign(payload)).rejects.toThrow(
`updateClientDesign request failed: Network error`,
`Network error in updateClientDesign: Network error`,
);
});

Expand All @@ -256,7 +256,7 @@ describe('AntigroHttpClientService', () => {

//@ts-expect-error
await expect(() => client.updateClientDesign(payload)).rejects.toThrow(
`Schema validation errored in updateClientDesign:`,
`Validation error in updateClientDesign:`,
);
});
});
Expand Down
3 changes: 1 addition & 2 deletions src/services/antigro-http-client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ export class AntigroHttpClientService extends HttpClient {
data: CreateClientDesignRequest,
): Promise<CreateClientDesignResponse> {
try {
const { designId } = data;
//validate data before sending request.
const safe_data = CreateClientDesignRequestSchema.parse(designId);
const safe_data = CreateClientDesignRequestSchema.parse(data);

//call endpoint
const response = await this.sendRequest({
Expand Down

0 comments on commit 43ec6f5

Please sign in to comment.