Skip to content

Commit

Permalink
test: add mock for expected retrun from graphKbStatement
Browse files Browse the repository at this point in the history
DEVSU-2049
  • Loading branch information
kttkjl committed Oct 31, 2023
1 parent dce6f3b commit 69623a1
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions test/graphkb.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,68 @@ jest.mock('../app/api/graphkb', () => {
}],
};
},

graphkbStatement: async (graphkbToken, statementId) => {
if (!graphkbToken) {
throw new Error('Invalid token');
}
if (!statementId) {
throw new Error('No statementId given');
}

return {
metadata: {
records: 1,
},
result: [
{
'@rid': '#153:13509',
conditions: [
{
'@class': 'PositionalVariant',
'@rid': '#159:5455',
deletedAt: null,
displayName: 'BRAF:p.V600E',
name: null,
},
{
'@class': 'Therapy',
'@rid': '#123:40604',
deletedAt: null,
displayName: 'panitumumab [DB01269]',
name: 'panitumumab',
},
{
'@class': 'Disease',
'@rid': '#135:19439',
deletedAt: null,
displayName: 'colorectal adenocarcinoma [COADREAD]',
name: 'colorectal adenocarcinoma',
},
],
evidenceLevel: [
{
'@rid': '#105:24',
displayName: 'MOAlmanac Guideline',
name: 'guideline',
},
],
relevance: {
'@rid': '#146:46',
displayName: 'resistance',
},
source: {
'@rid': '#37:17',
name: 'moa',
},
subject: {
'@class': 'Therapy',
'@rid': '#123:40604',
displayName: 'panitumumab [DB01269]',
},
},
],
};
},
};
});

0 comments on commit 69623a1

Please sign in to comment.