File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ describe('Per Resource Events Protocol', function () {
2424 } )
2525
2626 after ( ( ) => {
27+ fs . rmSync ( path . join ( samplePath , 'example-post' ) , { recursive : true } )
2728 server . close ( )
2829 } )
2930
@@ -129,6 +130,25 @@ solid:inserts { <u> <v> <z>. }.`
129130 expect ( notification . origin ) . to . match ( / s a m p l e C o n t a i n e r \/ .* e x a m p l e - p r e p .t t l $ / )
130131 } )
131132
133+ it ( 'when a container is created by POST' ,
134+ async function ( ) {
135+ await fetch ( 'http://localhost:8443/sampleContainer/' , {
136+ method : 'POST' ,
137+ headers : {
138+ slug : 'example-post' ,
139+ link : '<http://www.w3.org/ns/ldp#BasicContainer>; rel="type"' ,
140+ 'content-type' : 'text/turtle'
141+ }
142+ } )
143+ const { value } = await notificationsIterator . next ( )
144+ expect ( value . headers . get ( 'content-type' ) ) . to . match ( / a p p l i c a t i o n \/ l d \+ j s o n / )
145+ const notification = await value . json ( )
146+ expect ( notification ) . to . haveOwnProperty ( 'published' )
147+ expect ( notification . type ) . to . equal ( 'Add' )
148+ expect ( notification . object ) . to . match ( / s a m p l e C o n t a i n e r \/ $ / )
149+ expect ( notification . target ) . to . match ( / s a m p l e C o n t a i n e r \/ .* e x a m p l e - p o s t \/ $ / )
150+ } )
151+
132152 it ( 'when resource is created by POST' ,
133153 async function ( ) {
134154 await fetch ( 'http://localhost:8443/sampleContainer/' , {
You can’t perform that action at this time.
0 commit comments