@@ -17,6 +17,7 @@ const AccountManager = require('../../lib/models/account-manager')
1717const UserAccount = require ( '../../lib/models/user-account' )
1818const TokenService = require ( '../../lib/services/token-service' )
1919const WebIdTlsCertificate = require ( '../../lib/models/webid-tls-certificate' )
20+ const LegacyResourceMapper = require ( '../../lib/legacy-resource-mapper' )
2021
2122const testAccountsDir = path . join ( __dirname , '../resources/accounts' )
2223
@@ -102,17 +103,25 @@ describe('AccountManager', () => {
102103 describe ( 'accountDirFor()' , ( ) => {
103104 it ( 'should match the solid root dir config, in single user mode' , ( ) => {
104105 let multiuser = false
105- let store = new LDP ( { root : testAccountsDir , multiuser } )
106+ let resourceMapper = new LegacyResourceMapper ( {
107+ includeHost : multiuser ,
108+ rootPath : testAccountsDir
109+ } )
110+ let store = new LDP ( { multiuser, resourceMapper } )
106111 let options = { multiuser, store, host }
107112 let accountManager = AccountManager . from ( options )
108113
109114 let accountDir = accountManager . accountDirFor ( 'alice' )
110- expect ( accountDir ) . to . equal ( store . root )
115+ expect ( accountDir ) . to . equal ( store . resourceMapper . _rootPath )
111116 } )
112117
113118 it ( 'should compose the account dir in multi user mode' , ( ) => {
114119 let multiuser = true
115- let store = new LDP ( { root : testAccountsDir , multiuser } )
120+ let resourceMapper = new LegacyResourceMapper ( {
121+ includeHost : multiuser ,
122+ rootPath : testAccountsDir
123+ } )
124+ let store = new LDP ( { multiuser, resourceMapper } )
116125 let host = SolidHost . from ( { serverUri : 'https://localhost' } )
117126 let options = { multiuser, store, host }
118127 let accountManager = AccountManager . from ( options )
@@ -302,7 +311,10 @@ describe('AccountManager', () => {
302311
303312 describe ( 'rootAclFor()' , ( ) => {
304313 it ( 'should return the server root .acl in single user mode' , ( ) => {
305- let store = new LDP ( { suffixAcl : '.acl' , multiuser : false } )
314+ let resourceMapper = new LegacyResourceMapper ( {
315+ includeHost : false
316+ } )
317+ let store = new LDP ( { suffixAcl : '.acl' , multiuser : false , resourceMapper } )
306318 let options = { host, multiuser : false , store }
307319 let accountManager = AccountManager . from ( options )
308320
@@ -314,7 +326,10 @@ describe('AccountManager', () => {
314326 } )
315327
316328 it ( 'should return the profile root .acl in multi user mode' , ( ) => {
317- let store = new LDP ( { suffixAcl : '.acl' , multiuser : true } )
329+ let resourceMapper = new LegacyResourceMapper ( {
330+ includeHost : true
331+ } )
332+ let store = new LDP ( { suffixAcl : '.acl' , multiuser : true , resourceMapper } )
318333 let options = { host, multiuser : true , store }
319334 let accountManager = AccountManager . from ( options )
320335
0 commit comments