Skip to content

Commit cfdea82

Browse files
committed
test(analytics): a word equal to a measure and a dimension reads one_measure
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfR33NbV51QQU6R6bm
1 parent 284c04b commit cfdea82

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎packages/services/service-analytics/src/__tests__/dataset-tools.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,8 @@ const CRM_LINE_ITEM_METRICS = {
886886
name: 'crm_line_item_metrics',
887887
label: 'Line Item Metrics',
888888
object: 'crm_opportunity_line_item',
889-
dimensions: [{ name: 'product', label: 'Product', field: 'product', type: 'string' }],
889+
// `deal count` is also `opp_count`'s synonym in the other dataset: a word equal to a measure there and a dimension here.
890+
dimensions: [{ name: 'product', label: 'Product', field: 'product', type: 'string', synonyms: ['deal count'] }],
890891
measures: [
891892
{ name: 'line_amount', label: 'Line Amount', aggregate: 'sum', field: 'amount', synonyms: ['deal value', '明细金额'] },
892893
{ name: 'quantity_total', label: 'Quantity', aggregate: 'sum', field: 'quantity' },
@@ -1016,6 +1017,10 @@ describe('[#34919] list_datasets nextStep — the precedence among mixed cases',
10161017
expect(await decide(['商机金额', '商机数', '销售阶段'])).toEqual({ decision: 'one_measure', terms: ['商机金额', '商机数'] });
10171018
});
10181019

1020+
it('a word equal to one measure and to a dimension is one_measure: the dimension is not counted', async () => {
1021+
expect(await decide(['deal count'])).toEqual({ decision: 'one_measure', terms: ['deal count'] });
1022+
});
1023+
10191024
it('a word sent twice is one word, and the member it equals is counted once', async () => {
10201025
expect(await decide(['商机数', '商机数'])).toEqual({ decision: 'one_measure', terms: ['商机数'] });
10211026
});

0 commit comments

Comments
 (0)