1
1
import 'jest-rdf' ;
2
2
import {
3
+ joinUrl ,
3
4
KeyValueStorage ,
4
5
MethodNotAllowedHttpError ,
5
6
NotFoundHttpError ,
@@ -96,6 +97,7 @@ describe('ResourceRegistration', (): void => {
96
97
it ( 'registers the resource using the name as identifier.' , async ( ) : Promise < void > => {
97
98
await expect ( handler . handle ( input ) ) . resolves . toEqual ( {
98
99
status : 201 ,
100
+ headers : { location : `http://example.com/foo/name` } ,
99
101
body : { _id : 'name' , user_access_policy_uri : 'TODO: implement policy UI' } ,
100
102
} ) ;
101
103
expect ( resourceStore . set ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -109,6 +111,7 @@ describe('ResourceRegistration', (): void => {
109
111
input . request . body ! . resource_defaults = { pred : [ 'scope' ] , '@reverse' : { 'rPred' : [ 'otherScope' ] } } ;
110
112
await expect ( handler . handle ( input ) ) . resolves . toEqual ( {
111
113
status : 201 ,
114
+ headers : { location : `http://example.com/foo/name` } ,
112
115
body : { _id : 'name' , user_access_policy_uri : 'TODO: implement policy UI' } ,
113
116
} ) ;
114
117
expect ( policies . addRule ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -144,6 +147,7 @@ describe('ResourceRegistration', (): void => {
144
147
input . request . body ! . name = 'entry' ;
145
148
await expect ( handler . handle ( input ) ) . resolves . toEqual ( {
146
149
status : 201 ,
150
+ headers : { location : `http://example.com/foo/entry` } ,
147
151
body : { _id : 'entry' , user_access_policy_uri : 'TODO: implement policy UI' } ,
148
152
} ) ;
149
153
expect ( policies . addRule ) . toHaveBeenCalledTimes ( 1 ) ;
0 commit comments