Skip to content
Snippets Groups Projects
Commit d1823095 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

provide minerva version in report data

parent 15bef3eb
No related branches found
No related tags found
2 merge requests!223reset the pin numbers before search results are fetch (so the results will be...,!199Resolve "[MIN-321] form for reporting errors in minerva"
......@@ -7,6 +7,8 @@ import { userPrivilegesFixture } from '@/models/fixtures/userPrivilegesFixture';
import { login } from '@/redux/user/user.thunks';
import { mockNetworkResponse } from '@/utils/mockNetworkResponse';
import { store } from '@/redux/store';
import { getConfiguration } from '@/redux/configuration/configuration.thunks';
import { configurationFixture } from '@/models/fixtures/configurationFixture';
const mockedAxiosClient = mockNetworkResponse();
......@@ -52,4 +54,14 @@ describe('createErrorData', () => {
const error = createErrorData(new Error());
expect(error.timestamp).not.toBeNull();
});
it('should add version', async () => {
mockedAxiosClient
.onGet(apiPath.getConfiguration())
.reply(HttpStatusCode.Ok, configurationFixture);
await store.dispatch(getConfiguration());
const error = createErrorData(new Error());
expect(error.version).not.toBeNull();
});
});
......@@ -14,6 +14,8 @@ export const createErrorData = (error: Error | SerializedError | undefined): Err
if (!login) {
login = 'anonymous';
}
const configuration = store.getState().configuration.main.data;
const version = configuration ? configuration.version : null;
return {
url: window.location.href,
......@@ -24,7 +26,7 @@ export const createErrorData = (error: Error | SerializedError | undefined): Err
javaStacktrace: null, // TODO
stacktrace,
timestamp: Math.floor(+new Date() / ONE_THOUSAND),
version: null, // TODO
version,
};
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment