Skip to content

Commit 7fccd87

Browse files
committed
fix test cases
1 parent f2acbe8 commit 7fccd87

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

test/unit/bin/commands/runs.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ describe("runs", () => {
115115
setBrowsersStub = sandbox.stub();
116116
setConfigStub = sandbox.stub();
117117
setCLIModeStub = sandbox.stub();
118+
setGeolocationStub = sandbox.stub();
118119
});
119120

120121
afterEach(() => {
@@ -154,7 +155,8 @@ describe("runs", () => {
154155
setSystemEnvs: setSystemEnvsStub,
155156
setBrowsers: setBrowsersStub,
156157
setConfig: setConfigStub,
157-
setCLIMode: setCLIModeStub
158+
setCLIMode: setCLIModeStub,
159+
setGeolocation: setGeolocationStub
158160
},
159161
'../helpers/capabilityHelper': {
160162
validate: capabilityValidatorStub
@@ -194,6 +196,7 @@ describe("runs", () => {
194196
sinon.assert.calledOnce(getErrorCodeFromMsgStub);
195197
sinon.assert.calledOnce(setLocalIdentifierStub);
196198
sinon.assert.calledOnce(setUsageReportingFlagStub);
199+
sinon.assert.calledOnce(setGeolocationStub);
197200
sinon.assert.calledOnceWithExactly(
198201
sendUsageReportStub,
199202
bsConfig,
@@ -249,6 +252,7 @@ describe("runs", () => {
249252
setBrowsersStub = sandbox.stub();
250253
setConfigStub = sandbox.stub();
251254
setCLIModeStub = sandbox.stub();
255+
setGeolocationStub = sandbox.stub();
252256
});
253257

254258
afterEach(() => {
@@ -290,7 +294,8 @@ describe("runs", () => {
290294
setSystemEnvs: setSystemEnvsStub,
291295
setBrowsers: setBrowsersStub,
292296
setConfig: setConfigStub,
293-
setCLIMode: setCLIModeStub
297+
setCLIMode: setCLIModeStub,
298+
setGeolocation: setGeolocationStub
294299
},
295300
'../helpers/capabilityHelper': {
296301
validate: capabilityValidatorStub,
@@ -348,6 +353,7 @@ describe("runs", () => {
348353
sinon.assert.calledOnce(deleteResultsStub);
349354
sinon.assert.calledOnce(setDefaultsStub);
350355
sinon.assert.calledOnce(setSystemEnvsStub);
356+
sinon.assert.calledOnce(setGeolocationStub);
351357
sinon.assert.calledOnceWithExactly(
352358
sendUsageReportStub,
353359
bsConfig,
@@ -405,6 +411,7 @@ describe("runs", () => {
405411
setBrowsersStub = sandbox.stub();
406412
setCLIModeStub = sandbox.stub();
407413
fetchZipSizeStub = sandbox.stub();
414+
setGeolocationStub = sandbox.stub();
408415
});
409416

410417
afterEach(() => {
@@ -448,6 +455,7 @@ describe("runs", () => {
448455
setConfig: setConfigStub,
449456
setCLIMode: setCLIModeStub,
450457
fetchZipSize: fetchZipSizeStub,
458+
setGeolocation: setGeolocationStub,
451459
},
452460
'../helpers/capabilityHelper': {
453461
validate: capabilityValidatorStub,
@@ -507,6 +515,7 @@ describe("runs", () => {
507515
sinon.assert.calledOnce(deleteResultsStub);
508516
sinon.assert.calledOnce(setDefaultsStub);
509517
sinon.assert.calledOnce(setSystemEnvsStub);
518+
sinon.assert.calledOnce(setGeolocationStub);
510519
sinon.assert.calledOnceWithExactly(
511520
sendUsageReportStub,
512521
bsConfig,
@@ -569,6 +578,7 @@ describe("runs", () => {
569578
setBrowsersStub = sandbox.stub();
570579
setCLIModeStub = sandbox.stub();
571580
fetchZipSizeStub = sandbox.stub();
581+
setGeolocationStub = sandbox.stub();
572582
});
573583

574584
afterEach(() => {
@@ -613,6 +623,7 @@ describe("runs", () => {
613623
setConfig: setConfigStub,
614624
setCLIMode: setCLIModeStub,
615625
fetchZipSize: fetchZipSizeStub,
626+
setGeolocation: setGeolocationStub,
616627
},
617628
'../helpers/capabilityHelper': {
618629
validate: capabilityValidatorStub,
@@ -683,6 +694,7 @@ describe("runs", () => {
683694
sinon.assert.calledOnce(deleteResultsStub);
684695
sinon.assert.calledOnce(setDefaultsStub);
685696
sinon.assert.calledOnce(setSystemEnvsStub);
697+
sinon.assert.calledOnce(setGeolocationStub);
686698

687699
sinon.assert.calledOnceWithExactly(
688700
sendUsageReportStub,
@@ -759,6 +771,7 @@ describe("runs", () => {
759771
setCLIModeStub = sandbox.stub();
760772
setProcessHooksStub = sandbox.stub();
761773
fetchZipSizeStub = sandbox.stub();
774+
setGeolocationStub = sandbox.stub();
762775
});
763776

764777
afterEach(() => {
@@ -771,7 +784,7 @@ describe("runs", () => {
771784
let errorCode = null;
772785
let message = `Success! ${Constants.userMessages.BUILD_CREATED} with build id: random_build_id`;
773786
let dashboardLink = `${Constants.userMessages.VISIT_DASHBOARD} ${dashboardUrl}`;
774-
let data = { user_id: 1234, parallels: 10, time_components: {}, unique_id: 'random_hash', package_error: 'test', checkmd5_error: 'test', build_id: 'random_build_id', test_zip_size: 123, npm_zip_size: 123}
787+
let data = { user_id: 1234, parallels: 10, time_components: {}, unique_id: 'random_hash', package_error: 'test', checkmd5_error: 'test', build_id: 'random_build_id', test_zip_size: 123, npm_zip_size: 123, test_suite_zip_upload: 1, package_zip_upload: 1}
775788

776789
const runs = proxyquire('../../../../bin/commands/runs', {
777790
'../helpers/utils': {
@@ -811,6 +824,7 @@ describe("runs", () => {
811824
setCLIMode: setCLIModeStub,
812825
setProcessHooks: setProcessHooksStub,
813826
fetchZipSize: fetchZipSizeStub,
827+
setGeolocation: setGeolocationStub,
814828
},
815829
'../helpers/capabilityHelper': {
816830
validate: capabilityValidatorStub,
@@ -898,6 +912,7 @@ describe("runs", () => {
898912
sinon.assert.calledOnce(deleteResultsStub);
899913
sinon.assert.calledOnce(setDefaultsStub);
900914
sinon.assert.calledOnce(setSystemEnvsStub);
915+
sinon.assert.calledOnce(setGeolocationStub);
901916
sinon.assert.match(
902917
sendUsageReportStub.getCall(0).args,
903918
[

test/unit/bin/helpers/capabilityHelper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ describe("capabilityHelper.js", () => {
586586
cypress_proj_dir: "random path",
587587
cypressConfigFilePath: "random path"
588588
},
589+
connection_settings: {local: false}
589590
};
590591
});
591592

@@ -952,6 +953,7 @@ describe("capabilityHelper.js", () => {
952953
cypressConfigFilePath: "random path",
953954
cypressProjectDir: "random path"
954955
},
956+
connection_settings: {local: false}
955957
};
956958
});
957959
it("validate cypress json is present", () => {
@@ -1081,6 +1083,7 @@ describe("capabilityHelper.js", () => {
10811083
cypressConfigFilePath: "random path",
10821084
cypressProjectDir: "random path"
10831085
},
1086+
connection_settings: {local: false}
10841087
};
10851088
});
10861089

0 commit comments

Comments
 (0)