Skip to content

Commit

Permalink
[Core] Optimise indexation (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmyb authored Aug 17, 2023
1 parent f8a8b76 commit 6a291a2
Show file tree
Hide file tree
Showing 7 changed files with 214 additions and 240 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as amqp from 'amqplib';
import {IAttributeDomain} from 'domain/attribute/attributeDomain';
import {ILibraryDomain} from 'domain/library/libraryDomain';
import {IRecordDomain} from 'domain/record/recordDomain';
import {IRecordRepo} from 'infra/record/recordRepo';
import {IConfig} from '_types/config';
import {IQueryInfos} from '_types/queryInfos';
import indexationManager from './indexationManagerDomain';
Expand Down Expand Up @@ -83,10 +82,6 @@ describe('Indexation Manager', () => {
});

test('index database', async () => {
const mockRecordRepo: Mockify<IRecordRepo> = {
updateRecord: jest.fn()
};

const mockRecordDomain: Mockify<IRecordDomain> = {
find: global.__mockPromise({
list: [
Expand All @@ -101,7 +96,8 @@ describe('Indexation Manager', () => {
};

const mockAttributeDomain: Mockify<IAttributeDomain> = {
getLibraryFullTextAttributes: global.__mockPromise([{id: 'id'}])
getLibraryFullTextAttributes: global.__mockPromise([{id: 'id'}]),
getLibraryAttributes: global.__mockPromise([{id: 'id'}])
};

const mockLibraryDomain: Mockify<ILibraryDomain> = {
Expand All @@ -120,7 +116,6 @@ describe('Indexation Manager', () => {
const indexation = indexationManager({
config: conf as IConfig,
'core.domain.record': mockRecordDomain as IRecordDomain,
'core.infra.record': mockRecordRepo as IRecordRepo,
'core.domain.attribute': mockAttributeDomain as IAttributeDomain,
'core.domain.library': mockLibraryDomain as ILibraryDomain,
'core.infra.indexation.indexationService': mockIndexationService as IIndexationService
Expand Down
Loading

0 comments on commit 6a291a2

Please sign in to comment.