File tree Expand file tree Collapse file tree 4 files changed +62
-5
lines changed Expand file tree Collapse file tree 4 files changed +62
-5
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " openhim-core" ,
33 "description" : " The OpenHIM core application that provides logging and routing of http requests" ,
4- "version" : " 8.3.0 " ,
4+ "version" : " 8.3.1 " ,
55 "main" : " ./lib/server.js" ,
66 "bin" : {
77 "openhim-core" : " ./bin/openhim-core.js"
Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ const AppSchema = new Schema({
1111 required : true
1212 } ,
1313 description : String ,
14- icon : {
15- data : Buffer ,
16- contentType : String
14+ icon : String ,
15+ type : {
16+ type : String ,
17+ enum : [ 'link' , 'embedded' ]
1718 } ,
1819 category : String ,
1920 access_roles : [ String ] ,
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ describe('API Integration Tests', () => {
2020 name : 'Test app' ,
2121 description : 'An app for testing the app framework' ,
2222 icon : 'data:image/png;base64, <base64>' ,
23- type : 'link|embedded ' ,
23+ type : 'link' ,
2424 category : 'Operations' ,
2525 access_roles : [ 'test-app-user' ] ,
2626 url : 'http://test-app.org/app' ,
Original file line number Diff line number Diff line change 1+ 'use strict'
2+
3+ /* eslint-env mocha */
4+ import should from 'should'
5+
6+ import { getApps , updateApp } from '../../src/api/apps'
7+ import { AppModelAPI } from '../../src/model/apps'
8+
9+ describe ( 'Apps' , ( ) => {
10+ afterEach ( async ( ) => {
11+ await AppModelAPI . deleteMany ( { } )
12+ } )
13+
14+ describe ( 'getApps' , ( ) => {
15+ it ( 'should fail when retrieving from mongo fails' , async ( ) => {
16+ const ctx = {
17+ request : {
18+ query : { }
19+ }
20+ }
21+
22+ await getApps ( ctx )
23+
24+ ctx . status . should . equal ( 500 )
25+ should . exist ( ctx . body . error )
26+ } )
27+ } )
28+
29+ describe ( 'updateApps' , ( ) => {
30+ it ( 'should fail when updating in mongo fails' , async ( ) => {
31+ const app = AppModelAPI ( {
32+ name : 'Test app1' ,
33+ description : 'An app for testing the app framework' ,
34+ icon : 'data:image/png;base64, <base64>' ,
35+ type : 'link' ,
36+ category : 'Operations' ,
37+ access_roles : [ 'test-app-user' ] ,
38+ url : 'http://test-app.org/app1' ,
39+ showInPortal : true ,
40+ showInSideBar : true
41+ } )
42+ await app . save ( )
43+
44+ const ctx = {
45+ request : {
46+ body : { }
47+ } ,
48+ status : 200
49+ }
50+
51+ await updateApp ( ctx , app . _id )
52+
53+ should . exist ( ctx . body . error )
54+ } )
55+ } )
56+ } )
You can’t perform that action at this time.
0 commit comments