Create a basic belief node that can be used in further stages to create inferred belief and be inputs for other nodes. #32
@@ -467,7 +467,7 @@ describe('BasicBeliefNode', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should preserve value when switching from text type to emotion type', async () => {
|
it('should automatically choose the first option when switching to emotion type, and carry on to the text values', async () => {
|
||||||
const mockNode: Node<BasicBeliefNodeData> = {
|
const mockNode: Node<BasicBeliefNodeData> = {
|
||||||
id: 'belief-1',
|
id: 'belief-1',
|
||||||
type: 'basic_belief',
|
type: 'basic_belief',
|
||||||
@@ -512,7 +512,7 @@ describe('BasicBeliefNode', () => {
|
|||||||
expect(updatedNode?.data.belief.type).toBe('emotion');
|
expect(updatedNode?.data.belief.type).toBe('emotion');
|
||||||
// The component doesn't reset the value when changing types
|
// The component doesn't reset the value when changing types
|
||||||
// So it keeps the old value even though it doesn't make sense for emotion type
|
// So it keeps the old value even though it doesn't make sense for emotion type
|
||||||
expect(updatedNode?.data.belief.value).toBe('some text');
|
expect(updatedNode?.data.belief.value).toBe('Happy');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user