+
+ Installations
-
-`;
-
-exports[`Analytics should match a snapshot when appsOfDeveloper loading true 1`] = `
-
-
-
- Analytics
-
-
- Total number of installations:
- 1
-
-
- To see specific installations please select an App from the list below:
-
-
+ The installations table below shows the individuals per client with a total number of installations per app
+
+
+
-
-
-
-
-`;
-
-exports[`Analytics should match a snapshot when no appId params 1`] = `
-
+ Total current installation for
+
+ test
+
+ :
+ 0
+
+
+ Total current installation for
+
+ asd
+
+ :
+ 0
+
+
-
- Analytics
-
-
- Total number of installations:
- 1
-
-
- To see specific installations please select an App from the list below:
-
-
-
-
-
-
+ "Header": "App Name",
+ "accessor": "appName",
+ },
+ Object {
+ "Header": "Client",
+ "accessor": "client",
+ },
+ Object {
+ "Header": "Date of installation",
+ "accessor": [Function],
+ },
+ Object {
+ "Header": "Date of Uninstallation",
+ "accessor": [Function],
+ },
+ ]
+ }
+ data={Array []}
+ loading={false}
+ scrollable={true}
+ />
+
+
+
`;
diff --git a/packages/marketplace/src/components/pages/__tests__/analytics.tsx b/packages/marketplace/src/components/pages/__tests__/analytics.tsx
index a1dab22d4a..e7cb6d8448 100644
--- a/packages/marketplace/src/components/pages/__tests__/analytics.tsx
+++ b/packages/marketplace/src/components/pages/__tests__/analytics.tsx
@@ -1,361 +1,538 @@
import * as React from 'react'
-import { mount, shallow } from 'enzyme'
+import { shallow } from 'enzyme'
import {
AnalyticsPage,
- transformListAppToSelectBoxOptions,
- transformAppInstalationsToTableColumsCompatible,
- handleSubmit,
+ InstallationTable,
+ handleSetPageNumber,
+ installationTableColumn,
+ handleMapAppNameToInstallation,
+ handleUseMemoData,
+ handleCountCurrentInstallationForEachApp,
+ sortAppByDateInstalled,
+ countAppHasInstallation,
+ countAppNoInstallation,
} from '../analytics'
import { installationsStub } from '@/sagas/__stubs__/installations'
-import { mockLoginSession, mockRefreshParams } from '@/core/__mocks__/store'
-import { AnalyticsPageProps, mapStateToProps, mapDispatchToProps } from '@/components/pages/analytics'
+import { mapStateToProps } from '@/components/pages/analytics'
import { appsDataStub } from '@/sagas/__stubs__/apps'
import { ReduxState } from '@/types/core'
-import { appDetailDataStub } from '@/sagas/__stubs__/app-detail'
-import { defaultAppAuthState } from '@/reducers/app-detail'
-import { RouteComponentProps, StaticContext } from 'react-router'
-import Routes from '@/constants/routes'
+import { DeveloperState } from '@/reducers/developer'
+import { AppInstallationsState } from '@/reducers/app-installations'
+jest.mock('@reapit/elements', () => ({
+ ...jest.requireActual('@reapit/elements'),
+ toLocalTime: jest.fn().mockReturnValue('localtime'),
+}))
jest.mock('../../../core/store')
-const routerProps = appId =>
- ({
- match: {
- params: {
- page: '2',
- },
- },
- location: {
- search: `page=1${appId ? `&appId=${appId}` : ''}`,
- },
- } as RouteComponentProps