Skip to content

Commit f4de9b4

Browse files
committed
Fix shortText test for convertible itemDef change
1 parent 6168d2e commit f4de9b4

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

tests/eventToShortText.test.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,30 @@ describe('[ESTX] eventToShortText', () => {
3737
});
3838

3939
it('[EST6] select with localized option label', () => {
40+
const itemDef = model.itemsDefs.forKey('body-vulva-bleeding');
41+
assert.ok(itemDef, 'itemDef should exist');
42+
const event = {
43+
content: 0.55,
44+
streamIds: [itemDef.data.streamId],
45+
type: itemDef.eventTypes[0]
46+
};
47+
const result = eventToShortText(event);
48+
assert.equal(result, 'Moderate');
49+
});
50+
51+
it('[EST6b] convertible with source block shows source data', () => {
4052
const itemDef = model.itemsDefs.forKey('body-vulva-mucus-inspect');
4153
assert.ok(itemDef, 'itemDef should exist');
4254
const event = {
43-
content: 'clear',
55+
content: {
56+
data: { threadiness: 0.4, stretchability: 0.3 },
57+
source: { key: 'mira', sourceData: 'Creamy' }
58+
},
4459
streamIds: [itemDef.data.streamId],
4560
type: itemDef.eventTypes[0]
4661
};
4762
const result = eventToShortText(event);
48-
assert.equal(result, 'Clear');
63+
assert.equal(result, 'Creamy (mira)');
4964
});
5065

5166
it('[EST7] date item returns ISO date string', () => {

0 commit comments

Comments
 (0)