Skip to content

Commit

Permalink
[DSC-1451] Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
atarix83 committed Dec 29, 2023
1 parent 55ffdcf commit a6f363d
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 1,956 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { PageInfo } from '../../../shared/page-info.model';
import { HALEndpointService } from '../../../shared/hal-endpoint.service';
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
import { createSuccessfulRemoteDataObject } from '../../../../shared/remote-data.utils';
import { openaireSuggestion, } from '../../../../shared/mocks/openaire.mock';
import { openaireSuggestion } from '../../../../shared/mocks/notifications.mock';
import { RequestEntry } from '../../../data/request-entry.model';
import { QualityAssuranceSuggestionDataService } from './quality-assurance-suggestion-data.service';
import { FindListOptions } from '../../../data/find-list-options.model';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { createSuccessfulRemoteDataObject } from '../../../../shared/remote-data
import {
openaireSuggestionTargetReciterOne,
openaireSuggestionTargetScopusOne,
openaireSuggestionTargetScopusTwo,
} from '../../../../shared/mocks/openaire.mock';
openaireSuggestionTargetScopusTwo
} from '../../../../shared/mocks/notifications.mock';
import { RequestEntry } from '../../../data/request-entry.model';
import { QualityAssuranceSuggestionTargetDataService } from './quality-assurance-suggestion-target-data.service';
import { FindListOptions } from '../../../data/find-list-options.model';
Expand Down
160 changes: 147 additions & 13 deletions src/app/shared/mocks/notifications.mock.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
import { of as observableOf } from 'rxjs';
import { ResourceType } from '../../core/shared/resource-type';
import { QualityAssuranceTopicObject } from '../../core/notifications/qa/models/quality-assurance-topic.model';
import { QualityAssuranceEventObject } from '../../core/notifications/qa/models/quality-assurance-event.model';
import {
QualityAssuranceTopicObject
} from '../../core/notifications/qa/models/quality-assurance-topic.model';
import {
QualityAssuranceEventObject
} from '../../core/notifications/qa/models/quality-assurance-event.model';
import {
QualityAssuranceTopicDataService
QualityAssuranceTopicDataService
} from '../../core/notifications/qa/topics/quality-assurance-topic-data.service';
import {
QualityAssuranceEventDataService
QualityAssuranceEventDataService
} from '../../core/notifications/qa/events/quality-assurance-event-data.service';
import { DSpaceObject } from '../../core/shared/dspace-object.model';
import { Item } from '../../core/shared/item.model';
import {
createNoContentRemoteDataObject$,
createSuccessfulRemoteDataObject,
createSuccessfulRemoteDataObject$
createNoContentRemoteDataObject$,
createSuccessfulRemoteDataObject,
createSuccessfulRemoteDataObject$
} from '../remote-data.utils';
import { SearchResult } from '../search/models/search-result.model';
import { QualityAssuranceSourceObject } from '../../core/notifications/qa/models/quality-assurance-source.model';
import {
QualityAssuranceSourceObject
} from '../../core/notifications/qa/models/quality-assurance-source.model';
OpenaireSuggestionTarget
} from '../../core/notifications/reciter-suggestions/models/openaire-suggestion-target.model';
import { OpenaireSuggestion } from '../../core/notifications/reciter-suggestions/models/openaire-suggestion.model';

// REST Mock ---------------------------------------------------------------------
// -------------------------------------------------------------------------------
Expand Down Expand Up @@ -1870,3 +1868,139 @@ export function getMockSuggestionsService(): any {
getTargetUuid: jasmine.createSpy('getTargetUuid'),
});
}

export const openaireSuggestionTargetScopusOne: OpenaireSuggestionTarget = {
'id': 'scopus:nhy567-9d6d-ty67-b905-fef0f8cae26',
'display': 'Digilio, Giuseppe',
'source': 'scopus',
'total': 4,
'type': new ResourceType('suggestiontarget'),
'_links': {
'target': {
'href': 'https://dspace7.4science.cloud/server/api/core/items/nhy567-9d6d-ty67-b905-fef0f8cae26'
},
'suggestions': {
'href': 'https://dspace7.4science.cloud/server/api/integration/suggestions/search/findByTargetAndSource?target=nhy567-9d6d-ty67-b905-fef0f8cae26'
},
'self': {
'href': 'https://dspace7.4science.cloud/server/api/integration/suggestiontargets/scopus:nhy567-9d6d-ty67-b905-fef0f8cae26'
}
}
};
export const openaireSuggestionTargetReciterOne: OpenaireSuggestionTarget = {
'id': 'reciter:gf3d657-9d6d-4a87-b905-fef0f8cae26',
'display': 'Bollini, Andrea',
'source': 'reciter',
'total': 3,
'type': new ResourceType('suggestiontarget'),
'_links': {
'target': {
'href': 'https://dspace7.4science.cloud/server/api/core/items/gf3d657-9d6d-4a87-b905-fef0f8cae26'
},
'suggestions': {
'href': 'https://dspace7.4science.cloud/server/api/integration/suggestions/search/findByTargetAndSource?target=gf3d657-9d6d-4a87-b905-fef0f8cae26'
},
'self': {
'href': 'https://dspace7.4science.cloud/server/api/integration/suggestiontargets/scopus:gf3d657-9d6d-4a87-b905-fef0f8cae26'
}
}
};
export const openaireSuggestionTargetScopusTwo: OpenaireSuggestionTarget = {
'id': 'scopus:gf3d657-9d6d-4a87-b905-fef0f8cae26',
'display': 'Bollini, Andrea',
'source': 'scopus',
'total': 11,
'type': new ResourceType('suggestiontarget'),
'_links': {
'target': {
'href': 'https://dspace7.4science.cloud/server/api/core/items/gf3d657-9d6d-4a87-b905-fef0f8cae26'
},
'suggestions': {
'href': 'https://dspace7.4science.cloud/server/api/integration/suggestions/search/findByTargetAndSource?target=gf3d657-9d6d-4a87-b905-fef0f8cae26&source=scopus'
},
'self': {
'href': 'https://dspace7.4science.cloud/server/api/integration/suggestiontargets/scopus:gf3d657-9d6d-4a87-b905-fef0f8cae26'
}
}
};
export const openaireSuggestion: OpenaireSuggestion = {
'id': 'reciter:gf3d657-9d6d-4a87-b905-fef0f8cae26:24694772',
'display': 'publication one',
'source': 'reciter',
'score': '62.7',
'externalSourceUri': 'https://dspace7.4science.cloud/server/api/integration/reciterSourcesEntry/pubmed/entryValues/24694772',
'evidences': {
'acceptedRejectedEvidence': {
'score': '2.7',
'notes': 'some notes, eventually empty or null'
},
'authorNameEvidence': {
'score': '0',
'notes': 'some notes, eventually empty or null'
},
'journalCategoryEvidence': {
'score': '6',
'notes': 'some notes, eventually empty or null'
},
'affiliationEvidence': {
'score': '23.7',
'notes': 'some notes, eventually empty or null'
},
'relationshipEvidence': {
'score': '9',
'notes': 'some notes, eventually empty or null'
},
'educationYearEvidence': {
'score': '3.6',
'notes': 'some notes, eventually empty or null'
},
'personTypeEvidence': {
'score': '4',
'notes': 'some notes, eventually empty or null'
},
'articleCountEvidence': {
'score': '6.7',
'notes': 'some notes, eventually empty or null'
},
'averageClusteringEvidence': {
'score': '7',
'notes': 'some notes, eventually empty or null'
}
},
'metadata': {
'dc.identifier.uri': [
{
'value': 'https://publication/0000-0003-3681-2038',
'language': null,
'authority': null,
'confidence': -1,
'place': -1
} as any
],
'dc.title': [
{
'value': 'publication one',
'language': null,
'authority': null,
'confidence': -1
} as any
],
'dc.date.issued': [
{
'value': '2010-11-03',
'language': null,
'authority': null,
'confidence': -1
} as any
]
},
'type': new ResourceType('suggestion'),
'_links': {
'target': {
'href': 'https://dspace7.4science.cloud/server/api/core/items/gf3d657-9d6d-4a87-b905-fef0f8cae26'
},
'self': {
'href': 'https://dspace7.4science.cloud/server/api/integration/suggestions/reciter:gf3d657-9d6d-4a87-b905-fef0f8cae26:24694772'
}
}
};
Loading

0 comments on commit a6f363d

Please sign in to comment.