Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yen Truong committed Aug 12, 2022
1 parent 82f8515 commit 8918580
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import { CustomFieldValueDA } from './CustomFieldValueDA';
* @public
*/
//add other builtin field value direct answer interfaces here
export type FieldValueDirectAnswer = CustomFieldValueDA;
export type FieldValueDirectAnswer = CustomFieldValueDA;
26 changes: 16 additions & 10 deletions tests/transformers/searchservice/createDirectAnswer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,29 +67,35 @@ it('can create a custom FieldValueDirectAnswer', () => {
const apiFieldValueDirectAnswer = {
type: 'FIELD_VALUE',
answer: {
value: '18888888888',
entityName: 'Barack Obama',
fieldName: 'Phone Number',
fieldApiName: 'mainPhone',
value: {
color: 'yellow',
os: 'android'
},
entityName: 'Obama Phone',
fieldName: 'Phone Description',
fieldApiName: 'phoneDescription',
fieldType: 'c010101.specialtype'
},
relatedItem: {
verticalConfigId: 'people',
verticalConfigId: 'phone',
data: {}
}
};
const actualDirectAnswer = createDirectAnswer(apiFieldValueDirectAnswer);
const expectedDirectAnswer: CustomFieldValueDA = {
type: DirectAnswerType.FieldValue,
value: '18888888888',
value: {
color: 'yellow',
os: 'android'
},
relatedResult: {
rawData: {},
source: Source.KnowledgeManager
},
verticalKey: 'people',
entityName: 'Barack Obama',
fieldName: 'Phone Number',
fieldApiName: 'mainPhone',
verticalKey: 'phone',
entityName: 'Obama Phone',
fieldName: 'Phone Description',
fieldApiName: 'phoneDescription',
fieldType: 'unknown'
};
expect(actualDirectAnswer).toMatchObject(expectedDirectAnswer);
Expand Down

0 comments on commit 8918580

Please sign in to comment.