Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 1e89644

Browse files
authored
Fix importing sample networks (#984)
Updated to fix problem when a expected file is not found
1 parent fe28347 commit 1e89644

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

packages/composer-playground/src/app/services/samplebusinessnetwork.service.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ describe('SampleBusinessNetworkService', () => {
220220
repos: sinon.stub().returns({
221221
contents: sinon.stub().returns({
222222
fetch: sinon.stub().returns(Promise.reject({
223-
status: '404'
223+
status: 404
224224
}))
225225
})
226226
})
@@ -389,7 +389,7 @@ describe('SampleBusinessNetworkService', () => {
389389
let octoMock = {
390390
repos: sinon.stub().returns({
391391
contents: sinon.stub().returns({
392-
fetch: sinon.stub().returns(Promise.reject({status: '404'}))
392+
fetch: sinon.stub().returns(Promise.reject({status: 404}))
393393
})
394394
})
395395
};
@@ -618,7 +618,7 @@ describe('SampleBusinessNetworkService', () => {
618618
};
619619

620620
repoMock.contents.withArgs('packages/lib').returns({
621-
fetch: sinon.stub().returns(Promise.reject({status: '404'}))
621+
fetch: sinon.stub().returns(Promise.reject({status: 404}))
622622
});
623623

624624
let octoMock = {
@@ -709,7 +709,7 @@ describe('SampleBusinessNetworkService', () => {
709709
};
710710

711711
repoMock.contents.returns({
712-
fetch: sinon.stub().returns(Promise.reject({status: '404'}))
712+
fetch: sinon.stub().returns(Promise.reject({status: 404}))
713713
});
714714

715715
let octoMock = {
@@ -800,7 +800,7 @@ describe('SampleBusinessNetworkService', () => {
800800
};
801801

802802
repoMock.contents.returns({
803-
fetch: sinon.stub().returns(Promise.reject({status: '404'}))
803+
fetch: sinon.stub().returns(Promise.reject({status: 404}))
804804
});
805805

806806
let octoMock = {

packages/composer-playground/src/app/services/samplebusinessnetwork.service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class SampleBusinessNetworkService {
104104
return this.getModelsInfoMonoRepo(owner, repository, result);
105105
})
106106
.catch((error) => {
107-
if (error.status === '404') {
107+
if (error.status === 404) {
108108
return this.getSampleNetworkInfo(owner, repository, '')
109109
.then((info) => {
110110
let infoArray = [];
@@ -153,7 +153,7 @@ export class SampleBusinessNetworkService {
153153
})
154154
.catch((error) => {
155155
// we don't have a mono-repo so just get the model
156-
if (error.status === '404') {
156+
if (error.status === 404) {
157157
return this.getModel(owner, repository, '');
158158
} else {
159159
throw error;
@@ -256,7 +256,7 @@ export class SampleBusinessNetworkService {
256256
})
257257
.catch((error) => {
258258
// don't need scripts files to be valid
259-
if (error.status === '404') {
259+
if (error.status === 404) {
260260
return Promise.resolve();
261261
}
262262
throw error;
@@ -281,7 +281,7 @@ export class SampleBusinessNetworkService {
281281
})
282282
.catch((error) => {
283283
// don't need to have a permissions file to be valid
284-
if (error.status === '404') {
284+
if (error.status === 404) {
285285
return Promise.resolve();
286286
}
287287
throw error;
@@ -306,7 +306,7 @@ export class SampleBusinessNetworkService {
306306
})
307307
.catch((error) => {
308308
// don't need to have a readme file to be valid
309-
if (error.status === '404') {
309+
if (error.status === 404) {
310310
return Promise.resolve();
311311
}
312312
throw error;

0 commit comments

Comments
 (0)