mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[ACS-8664] generic question redirection to hx insight (#10174)
* ACS-8664 Loading HX insight url * ACS-8664 Added documentation for loading config of Knowledge Retrieval * ACS-8664 Unit tests * ACS-8664 Fixed unit tests * ACS-8664 Fixed unit tests after rebase * ACS-8664 Addressed comment
This commit is contained in:
committed by
Aleksander Sklorz
parent
13fc92e62c
commit
0a717d612f
@@ -21,68 +21,49 @@ import nock from 'nock';
|
||||
export class SearchAiMock extends BaseMock {
|
||||
mockGetAsk200Response(): void {
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.get('/alfresco/api/-default-/private/hxi/versions/1/questions', [
|
||||
.post('/alfresco/api/-default-/private/hxi/versions/1/agents/id1/questions', [
|
||||
{
|
||||
question: 'some question 1',
|
||||
restrictionQuery: 'some node id 1'
|
||||
},
|
||||
{
|
||||
question: 'some question 2',
|
||||
restrictionQuery: 'some node id 2,some node id 3'
|
||||
restrictionQuery: {
|
||||
nodesIds: ['some node id 1']
|
||||
}
|
||||
}
|
||||
])
|
||||
.reply(200, [
|
||||
{
|
||||
.reply(200, {
|
||||
entry: {
|
||||
question: 'some question 1',
|
||||
questionId: 'some id 1',
|
||||
restrictionQuery: 'some node id 1'
|
||||
},
|
||||
{
|
||||
question: 'some question 2',
|
||||
questionId: 'some id 2',
|
||||
restrictionQuery: 'some node id 2,some node id 3'
|
||||
restrictionQuery: {
|
||||
nodesIds: ['some node id 1']
|
||||
}
|
||||
}
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
mockGetAnswer200Response(): void {
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.get('/alfresco/api/-default-/private/hxi/versions/1/answers/-default-?questionId=id1')
|
||||
.get('/alfresco/api/-default-/private/hxi/versions/1/questions/id1/answers/-default-')
|
||||
.reply(200, {
|
||||
list: {
|
||||
pagination: {
|
||||
count: 2,
|
||||
hasMoreItems: false,
|
||||
skipCount: 0,
|
||||
maxItems: 100
|
||||
},
|
||||
entries: [
|
||||
entry: {
|
||||
answer: 'Some answer 1',
|
||||
questionId: 'some id 1',
|
||||
references: [
|
||||
{
|
||||
entry: {
|
||||
answer: 'Some answer 1',
|
||||
questionId: 'some id 1',
|
||||
references: [
|
||||
{
|
||||
referenceId: 'some reference id 1',
|
||||
referenceText: 'some reference text 1'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
entry: {
|
||||
answer: 'Some answer 2',
|
||||
questionId: 'some id 2',
|
||||
references: [
|
||||
{
|
||||
referenceId: 'some reference id 2',
|
||||
referenceText: 'some reference text 2'
|
||||
}
|
||||
]
|
||||
}
|
||||
referenceId: 'some reference id 1',
|
||||
referenceText: 'some reference text 1'
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
mockGetConfig200Response(): void {
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.get('/alfresco/api/-default-/private/hxi/versions/1/config/-default-')
|
||||
.reply(200, {
|
||||
entry: {
|
||||
knowledgeRetrievalUrl: 'https://some-url'
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user