mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 03:42:16 +00:00
feat(core): Implement granularity and date range filtering on insights (#14841)
This commit is contained in:
committed by
GitHub
parent
5ff073bd7b
commit
28596a633e
@@ -1,5 +1,7 @@
|
||||
import { Container } from '@n8n/di';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
|
||||
import type { AuthenticatedRequest } from '@/requests';
|
||||
import { mockInstance } from '@test/mocking';
|
||||
import * as testDb from '@test-integration/test-db';
|
||||
|
||||
@@ -30,7 +32,10 @@ describe('InsightsController', () => {
|
||||
insightsByPeriodRepository.getPreviousAndCurrentPeriodTypeAggregates.mockResolvedValue([]);
|
||||
|
||||
// ACT
|
||||
const response = await controller.getInsightsSummary();
|
||||
const response = await controller.getInsightsSummary(
|
||||
mock<AuthenticatedRequest>(),
|
||||
mock<Response>(),
|
||||
);
|
||||
|
||||
// ASSERT
|
||||
expect(response).toEqual({
|
||||
@@ -52,7 +57,10 @@ describe('InsightsController', () => {
|
||||
]);
|
||||
|
||||
// ACT
|
||||
const response = await controller.getInsightsSummary();
|
||||
const response = await controller.getInsightsSummary(
|
||||
mock<AuthenticatedRequest>(),
|
||||
mock<Response>(),
|
||||
);
|
||||
|
||||
// ASSERT
|
||||
expect(response).toEqual({
|
||||
@@ -78,7 +86,10 @@ describe('InsightsController', () => {
|
||||
]);
|
||||
|
||||
// ACT
|
||||
const response = await controller.getInsightsSummary();
|
||||
const response = await controller.getInsightsSummary(
|
||||
mock<AuthenticatedRequest>(),
|
||||
mock<Response>(),
|
||||
);
|
||||
|
||||
// ASSERT
|
||||
expect(response).toEqual({
|
||||
|
||||
Reference in New Issue
Block a user