Skip to content

Commit

Permalink
fix: Remove default root container from InMemoryDataAccessor
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimvh committed Feb 11, 2021
1 parent 6424b07 commit bb65630
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/storage/accessors/InMemoryDataAccessor.ts
Expand Up @@ -31,8 +31,7 @@ export class InMemoryDataAccessor implements DataAccessor {

const metadata = new RepresentationMetadata({ path: this.base });
metadata.addQuads(generateResourceQuads(DataFactory.namedNode(this.base), true));
const rootContainer = { entries: {}, metadata };
this.store = { entries: { '': rootContainer }};
this.store = { entries: { }};
}

public async canHandle(): Promise<void> {
Expand Down
9 changes: 9 additions & 0 deletions test/integration/LpdHandlerOperations.test.ts
Expand Up @@ -17,6 +17,15 @@ describe('An integrated AuthenticatedLdpHandler', (): void => {
'urn:solid-server:default:variable:baseUrl': BASE,
},
) as HttpHandler;

// The tests depend on there being a root container here
await performRequest(
handler,
new URL('http://test.com/'),
'PUT',
{ 'content-type': 'text/turtle', 'transfer-encoding': 'chunked' },
[ ],
);
});

it('can add, read and delete data based on incoming requests.', async(): Promise<void> => {
Expand Down
4 changes: 2 additions & 2 deletions test/integration/WebSocketsProtocol.test.ts
Expand Up @@ -28,9 +28,9 @@ describe('A server with the Solid WebSockets API behind a proxy', (): void => {
});
});

it('returns a 200.', async(): Promise<void> => {
it('returns a 404 if no data was initialized.', async(): Promise<void> => {
const response = await fetch(serverUrl, { headers });
expect(response.status).toBe(200);
expect(response.status).toBe(404);
});

it('sets the Updates-Via header.', async(): Promise<void> => {
Expand Down

0 comments on commit bb65630

Please sign in to comment.