Skip to content

Commit

Permalink
Use correct property for handle viewer event (#722)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinHoldstock authored Mar 19, 2018
1 parent 929e5bf commit 61fa208
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lib/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ class Preview extends EventEmitter {

// Explicit preview failure
this.handleViewerMetrics({
event_name: 'failure'
event: 'failure'
});

// Hookup for phantom JS health check
Expand All @@ -1216,7 +1216,7 @@ class Preview extends EventEmitter {

// Explicit preview success
this.handleViewerMetrics({
event_name: 'success'
event: 'success'
});

// If there wasn't an error and event logging is not disabled, use Events API to log a preview
Expand Down
4 changes: 2 additions & 2 deletions src/lib/__tests__/Preview-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1745,7 +1745,7 @@ describe('lib/Preview', () => {

preview.finishLoading();

expect(handleViewerMetrics).to.be.calledWith({ event_name });
expect(handleViewerMetrics).to.be.calledWith({ event: event_name });
});

it('should emit a metrics message for failed preview', () => {
Expand All @@ -1756,7 +1756,7 @@ describe('lib/Preview', () => {

preview.finishLoading({ error: {} });

expect(handleViewerMetrics).to.be.calledWith({ event_name });
expect(handleViewerMetrics).to.be.calledWith({ event: event_name });
});

it('should emit the load event', () => {
Expand Down

0 comments on commit 61fa208

Please sign in to comment.