11import 'jest-rdf' ;
22import {
3+ joinUrl ,
34 KeyValueStorage ,
45 MethodNotAllowedHttpError ,
56 NotFoundHttpError ,
@@ -96,6 +97,7 @@ describe('ResourceRegistration', (): void => {
9697 it ( 'registers the resource using the name as identifier.' , async ( ) : Promise < void > => {
9798 await expect ( handler . handle ( input ) ) . resolves . toEqual ( {
9899 status : 201 ,
100+ headers : { location : `http://example.com/foo/name` } ,
99101 body : { _id : 'name' , user_access_policy_uri : 'TODO: implement policy UI' } ,
100102 } ) ;
101103 expect ( resourceStore . set ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -109,6 +111,7 @@ describe('ResourceRegistration', (): void => {
109111 input . request . body ! . resource_defaults = { pred : [ 'scope' ] , '@reverse' : { 'rPred' : [ 'otherScope' ] } } ;
110112 await expect ( handler . handle ( input ) ) . resolves . toEqual ( {
111113 status : 201 ,
114+ headers : { location : `http://example.com/foo/name` } ,
112115 body : { _id : 'name' , user_access_policy_uri : 'TODO: implement policy UI' } ,
113116 } ) ;
114117 expect ( policies . addRule ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -144,6 +147,7 @@ describe('ResourceRegistration', (): void => {
144147 input . request . body ! . name = 'entry' ;
145148 await expect ( handler . handle ( input ) ) . resolves . toEqual ( {
146149 status : 201 ,
150+ headers : { location : `http://example.com/foo/entry` } ,
147151 body : { _id : 'entry' , user_access_policy_uri : 'TODO: implement policy UI' } ,
148152 } ) ;
149153 expect ( policies . addRule ) . toHaveBeenCalledTimes ( 1 ) ;
0 commit comments