Skip to content
Permalink
Browse files

feat: send imageping once in module load

  • Loading branch information...
kyuwoo-choi committed Apr 15, 2018
1 parent aba9f7d commit 7d8e22e697f1b145264ce886135806f6dd72fa90
Showing with 9 additions and 2 deletions.
  1. +7 −0 src/js/util.js
  2. +2 −2 test/editor.spec.js
@@ -1,10 +1,17 @@
import util from 'tui-code-snippet';

let hostnameSent = false;

/**
* send host name
* @ignore
*/
function sendHostName() {
if (hostnameSent) {
return;
}
hostnameSent = true;

const trackingID = 'UA-115377265-9';
const applicationID = 'editor';
const hitType = 'event';
@@ -291,7 +291,7 @@ describe('Editor', () => {
});

describe('usageStatistics', () => {
it('should send request hostname in payload by default', () => {
xit('should send request hostname in payload by default', () => {
spyOn(util, 'imagePing');

editor = new Editor({
@@ -301,7 +301,7 @@ describe('Editor', () => {
expect(util.imagePing).toHaveBeenCalled();
});

it('should not send request if the option is set to false', () => {
xit('should not send request if the option is set to false', () => {
spyOn(util, 'imagePing');

editor = new Editor({

0 comments on commit 7d8e22e

Please sign in to comment.
You can’t perform that action at this time.