mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
test: Use Components.js in AuthenticatedLdpHandler.
This commit is contained in:
@@ -3,24 +3,23 @@ import * as url from 'url';
|
||||
import { namedNode, quad } from '@rdfjs/data-model';
|
||||
import { Parser } from 'n3';
|
||||
import type { MockResponse } from 'node-mocks-http';
|
||||
import { RootContainerInitializer } from '../../src/init/RootContainerInitializer';
|
||||
import type { HttpHandler } from '../../src/server/HttpHandler';
|
||||
import { LDP } from '../../src/util/UriConstants';
|
||||
import { BasicConfig } from '../configs/BasicConfig';
|
||||
import { BasicHandlersConfig } from '../configs/BasicHandlersConfig';
|
||||
import { BASE } from '../configs/Util';
|
||||
import { BASE, instantiateFromConfig } from '../configs/Util';
|
||||
import { call } from '../util/Util';
|
||||
|
||||
describe('An integrated AuthenticatedLdpHandler', (): void => {
|
||||
let handler: HttpHandler;
|
||||
|
||||
beforeAll(async(): Promise<void> => {
|
||||
handler = await instantiateFromConfig(
|
||||
'urn:solid-server:default:LdpHandler', 'auth-allow-all.json', {
|
||||
'urn:solid-server:default:variable:baseUrl': BASE,
|
||||
},
|
||||
) as HttpHandler;
|
||||
});
|
||||
|
||||
describe('with simple handlers', (): void => {
|
||||
const config = new BasicConfig();
|
||||
const handler = config.getHttpHandler();
|
||||
|
||||
beforeAll(async(): Promise<void> => {
|
||||
// Initialize store
|
||||
const initializer = new RootContainerInitializer(BASE, config.store);
|
||||
await initializer.handleSafe();
|
||||
});
|
||||
|
||||
it('can add, read and delete data based on incoming requests.', async(): Promise<void> => {
|
||||
// POST
|
||||
let requestUrl = new URL('http://test.com/');
|
||||
@@ -70,15 +69,6 @@ describe('An integrated AuthenticatedLdpHandler', (): void => {
|
||||
});
|
||||
|
||||
describe('with simple PATCH handlers', (): void => {
|
||||
const config = new BasicHandlersConfig();
|
||||
const handler = config.getHttpHandler();
|
||||
|
||||
beforeAll(async(): Promise<void> => {
|
||||
// Initialize store
|
||||
const initializer = new RootContainerInitializer(BASE, config.store);
|
||||
await initializer.handleSafe();
|
||||
});
|
||||
|
||||
it('can handle simple SPARQL updates.', async(): Promise<void> => {
|
||||
// POST
|
||||
let requestUrl = new URL('http://test.com/');
|
||||
@@ -142,15 +132,6 @@ describe('An integrated AuthenticatedLdpHandler', (): void => {
|
||||
});
|
||||
|
||||
describe('with simple PUT handlers', (): void => {
|
||||
const config = new BasicHandlersConfig();
|
||||
const handler = config.getHttpHandler();
|
||||
|
||||
beforeAll(async(): Promise<void> => {
|
||||
// Initialize store
|
||||
const initializer = new RootContainerInitializer(BASE, config.store);
|
||||
await initializer.handleSafe();
|
||||
});
|
||||
|
||||
it('should overwrite the content on PUT request.', async(): Promise<void> => {
|
||||
// POST
|
||||
let requestUrl = new URL('http://test.com/');
|
||||
|
||||
Reference in New Issue
Block a user