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

Commit 444dbfc

Browse files
committed
Edit Order Completed test to check for custom dimensions and metrics.
1 parent 9815077 commit 444dbfc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/index.test.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,6 +1381,10 @@ describe('Google Analytics', function() {
13811381
});
13821382

13831383
it('should send order completed data', function() {
1384+
ga.options.setAllMappedProps = false;
1385+
ga.options.dimensions = { testDimension: 'dimension1' };
1386+
ga.options.metrics = { testMetric: 'metric1' };
1387+
13841388
analytics.track('order completed', {
13851389
orderId: '780bc55',
13861390
total: 99.9,
@@ -1389,6 +1393,8 @@ describe('Google Analytics', function() {
13891393
currency: 'CAD',
13901394
coupon: 'coupon',
13911395
affiliation: 'affiliation',
1396+
testDimension: true,
1397+
testMetric: true,
13921398
products: [{
13931399
quantity: 1,
13941400
price: 24.75,
@@ -1435,7 +1441,11 @@ describe('Google Analytics', function() {
14351441
shipping: 13.99,
14361442
coupon: 'coupon'
14371443
}]);
1438-
analytics.deepEqual(toArray(window.ga.args[5]), ['send', 'event', 'EnhancedEcommerce', 'order completed', { nonInteraction: 1 }]);
1444+
analytics.deepEqual(toArray(window.ga.args[5]), ['send', 'event', 'EnhancedEcommerce', 'order completed', {
1445+
nonInteraction: 1,
1446+
metric1: 'true',
1447+
dimension1: 'true'
1448+
}]);
14391449
});
14401450

14411451
it('should add coupon to product level in order completed', function() {

0 commit comments

Comments
 (0)