chore: Remove assumption that DataAccessors have a root container by default

This commit is contained in:
Joachim Van Herwegen
2020-12-14 15:49:58 +01:00
parent 231349b30d
commit 36eed5d620
12 changed files with 86 additions and 33 deletions

View File

@@ -1,5 +1,7 @@
import type { MockResponse } from 'node-mocks-http';
import { RootContainerInitializer } from '../../src/init/RootContainerInitializer';
import { BasicHandlersWithAclConfig } from '../configs/BasicHandlersWithAclConfig';
import { BASE } from '../configs/Util';
import { AclTestHelper } from '../util/TestHelpers';
import { call } from '../util/Util';
@@ -9,6 +11,12 @@ describe('A server with authorization', (): void => {
const { store } = config;
const aclHelper = new AclTestHelper(store, 'http://test.com/');
beforeAll(async(): Promise<void> => {
// Initialize store
const initializer = new RootContainerInitializer(BASE, config.store);
await initializer.handleSafe();
});
it('can create new entries.', async(): Promise<void> => {
await aclHelper.setSimpleAcl({ read: true, write: true, append: true }, 'agent');