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 () {
24
24
} )
25
25
26
26
after ( ( ) => {
27
+ fs . rmSync ( path . join ( samplePath , 'example-post' ) , { recursive : true } )
27
28
server . close ( )
28
29
} )
29
30
@@ -129,6 +130,25 @@ solid:inserts { <u> <v> <z>. }.`
129
130
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 $ / )
130
131
} )
131
132
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
+
132
152
it ( 'when resource is created by POST' ,
133
153
async function ( ) {
134
154
await fetch ( 'http://localhost:8443/sampleContainer/' , {
You can’t perform that action at this time.
0 commit comments