Skip to content

Commit

Permalink
fix: linting error in test file (#142951)
Browse files Browse the repository at this point in the history
  • Loading branch information
TattdCodeMonkey authored Oct 9, 2022
1 parent f658a7d commit 19105a9
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ type HistorySearchResponse = SearchResponse<
inference_processors: AggregationsMultiBucketAggregateBase<AggregationsStringRareTermsBucketKeys>;
}
>;
const EmptyMockResponse: HistorySearchResponse = {
const emptyMockResponse: HistorySearchResponse = {
...DEFAULT_RESPONSE,
aggregations: {
inference_processors: {
buckets: [],
},
},
};
const ListMockResponse: HistorySearchResponse = {
const listMockResponse: HistorySearchResponse = {
...DEFAULT_RESPONSE,
aggregations: {
inference_processors: {
Expand All @@ -64,7 +64,7 @@ const ListMockResponse: HistorySearchResponse = {
},
},
};
const ObjectMockResponse: HistorySearchResponse = {
const objectMockResponse: HistorySearchResponse = {
...DEFAULT_RESPONSE,
aggregations: {
inference_processors: {
Expand All @@ -82,7 +82,7 @@ const ObjectMockResponse: HistorySearchResponse = {
},
};

const ExpectedMockResults: MlInferenceHistoryResponse = {
const expectedMockResults: MlInferenceHistoryResponse = {
history: [
{
doc_count: 20,
Expand All @@ -106,7 +106,7 @@ describe('fetchMlInferencePipelineHistory', () => {
});

it('should query ingest pipelines from documents', async () => {
mockClient.search.mockResolvedValue(EmptyMockResponse);
mockClient.search.mockResolvedValue(emptyMockResponse);

await fetchMlInferencePipelineHistory(client, indexName);
expect(mockClient.search).toHaveBeenCalledWith({
Expand All @@ -123,7 +123,7 @@ describe('fetchMlInferencePipelineHistory', () => {
});
});
it('should return empty history when no results found', async () => {
mockClient.search.mockResolvedValue(EmptyMockResponse);
mockClient.search.mockResolvedValue(emptyMockResponse);

const response = await fetchMlInferencePipelineHistory(client, indexName);
expect(response).toEqual({ history: [] });
Expand All @@ -135,15 +135,15 @@ describe('fetchMlInferencePipelineHistory', () => {
expect(response).toEqual({ history: [] });
});
it('should return history with aggregated list', async () => {
mockClient.search.mockResolvedValue(ListMockResponse);
mockClient.search.mockResolvedValue(listMockResponse);

const response = await fetchMlInferencePipelineHistory(client, indexName);
expect(response).toEqual(ExpectedMockResults);
expect(response).toEqual(expectedMockResults);
});
it('should return history with aggregated object', async () => {
mockClient.search.mockResolvedValue(ObjectMockResponse);
mockClient.search.mockResolvedValue(objectMockResponse);

const response = await fetchMlInferencePipelineHistory(client, indexName);
expect(response).toEqual(ExpectedMockResults);
expect(response).toEqual(expectedMockResults);
});
});

0 comments on commit 19105a9

Please sign in to comment.