feat: Emit container pub event on PUT.

Closes https://github.com/solid/community-server/issues/612
This commit is contained in:
Ruben Verborgh
2021-02-23 15:41:23 +01:00
committed by Joachim Van Herwegen
parent 6edc255707
commit c3cff553e3
15 changed files with 91 additions and 129 deletions

View File

@@ -68,14 +68,20 @@ describe('A server with the Solid WebSockets API behind a proxy', (): void => {
]);
});
describe('when the client subscribes to a resource', (): void => {
describe('when the client subscribes to resources', (): void => {
beforeAll(async(): Promise<void> => {
client.send(`sub https://example.pod/my-resource`);
client.send('sub https://example.pod/my-resource');
client.send('sub https://example.pod/other-resource');
client.send('sub https://example.pod/');
await new Promise((resolve): any => client.once('message', resolve));
});
it('acknowledges the subscription.', async(): Promise<void> => {
expect(messages).toEqual([ `ack https://example.pod/my-resource` ]);
expect(messages).toEqual([
'ack https://example.pod/my-resource',
'ack https://example.pod/other-resource',
'ack https://example.pod/',
]);
});
it('notifies the client of resource updates.', async(): Promise<void> => {
@@ -87,7 +93,10 @@ describe('A server with the Solid WebSockets API behind a proxy', (): void => {
},
body: '{}',
});
expect(messages).toEqual([ `pub https://example.pod/my-resource` ]);
expect(messages).toEqual([
'pub https://example.pod/',
'pub https://example.pod/my-resource',
]);
});
});
});