Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Commit a9de6a0

Browse files
committed
map monthlySpend to monthly_spend
1 parent 790848d commit a9de6a0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ Intercom.prototype.group = function(group) {
132132
// using .traits here since group.properties() doesn't take alias object
133133
var props = group.traits({
134134
createdAt: 'created',
135-
created: 'created_at'
135+
created: 'created_at',
136+
monthlySpend: 'monthly_spend'
136137
});
137138
props = convertDates(props, formatDate);
138139
var id = group.groupId();

test/index.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,11 @@ describe('Intercom', function() {
302302
analytics.called(window.Intercom, 'update', { company: { id: 'id' } });
303303
});
304304

305+
it('should send map monthlySpend to monthly_spend', function() {
306+
analytics.group('id', { monthlySpend: 17.38 });
307+
analytics.called(window.Intercom, 'update', { company: { id: 'id', monthly_spend: 17.38 } });
308+
});
309+
305310
it('should send an id and properties', function() {
306311
analytics.group('id', { name: 'Name' });
307312
analytics.called(window.Intercom, 'update', {

0 commit comments

Comments
 (0)