File tree 4 files changed +62
-5
lines changed
4 files changed +62
-5
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " openhim-core" ,
3
3
"description" : " The OpenHIM core application that provides logging and routing of http requests" ,
4
- "version" : " 8.3.0 " ,
4
+ "version" : " 8.3.1 " ,
5
5
"main" : " ./lib/server.js" ,
6
6
"bin" : {
7
7
"openhim-core" : " ./bin/openhim-core.js"
Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ const AppSchema = new Schema({
11
11
required : true
12
12
} ,
13
13
description : String ,
14
- icon : {
15
- data : Buffer ,
16
- contentType : String
14
+ icon : String ,
15
+ type : {
16
+ type : String ,
17
+ enum : [ 'link' , 'embedded' ]
17
18
} ,
18
19
category : String ,
19
20
access_roles : [ String ] ,
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ describe('API Integration Tests', () => {
20
20
name : 'Test app' ,
21
21
description : 'An app for testing the app framework' ,
22
22
icon : 'data:image/png;base64, <base64>' ,
23
- type : 'link|embedded ' ,
23
+ type : 'link' ,
24
24
category : 'Operations' ,
25
25
access_roles : [ 'test-app-user' ] ,
26
26
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