Skip to content

Commit

Permalink
fix(log): Fix log not getting serialized properly (#1180)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingze authored Mar 12, 2020
1 parent 31f65e5 commit e9b0c8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 1 addition & 4 deletions src/lib/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,7 @@ class Preview extends EventEmitter {

this.emitLogEvent(PREVIEW_METRIC, {
event_name: PREVIEW_END_EVENT,
value: {
duration: previewDuration,
viewer_status: this.viewer.getLoadStatus(),
},
value: previewDuration,
});
}

Expand Down
7 changes: 1 addition & 6 deletions src/lib/__tests__/Preview-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ describe('lib/Preview', () => {
preview.file = {
id: 1,
};
stubs.viewer.getLoadStatus.returns('loaded');
sandbox.stub(preview, 'emitLogEvent');
sandbox.stub(Timer, 'createTag').returns('duration_tag');
sandbox.stub(Timer, 'get').returns({ elapsed: 7 });
Expand All @@ -116,13 +115,9 @@ describe('lib/Preview', () => {
preview.destroy();
expect(Timer.createTag).to.be.called;
expect(Timer.stop).to.be.calledWith('duration_tag');
expect(stubs.viewer.getLoadStatus).to.be.called;
expect(preview.emitLogEvent).to.be.calledWith(PREVIEW_METRIC, {
event_name: 'preview_end',
value: {
duration: 7,
viewer_status: 'loaded',
},
value: 7,
});
});

Expand Down

0 comments on commit e9b0c8e

Please sign in to comment.