Skip to content

Commit fe05440

Browse files
committed
replace Settings with settings
1 parent 809edc2 commit fe05440

3 files changed

Lines changed: 39 additions & 39 deletions

File tree

src/util/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function differentOrigin(doc): boolean {
3333
export function suggestPreferencesFile (me:NamedNode) {
3434
const stripped = me.uri.replace('/profile/', '/').replace('/public/', '/')
3535
// const stripped = me.uri.replace(\/[p|P]rofile/\g, '/').replace(\/[p|P]ublic/\g, '/')
36-
const folderURI = stripped.split('/').slice(0,-1).join('/') + '/Settings/'
36+
const folderURI = stripped.split('/').slice(0,-1).join('/') + '/settings/'
3737
const fileURI = folderURI + 'prefs.ttl'
3838
return sym(fileURI)
3939
}

test/profileLogic.test.ts

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -166,44 +166,44 @@ describe('Profile', () => {
166166
throw new Error('Expected profile patch request for bob')
167167
}
168168
const profilePatchText = await profilePatch.text()
169-
expect(profilePatchText).toContain('INSERT DATA { <https://bob.example.com/profile/card.ttl#me> <http://www.w3.org/ns/pim/space#preferencesFile> <https://bob.example.com/Settings/prefs.ttl> .')
169+
expect(profilePatchText).toContain('INSERT DATA { <https://bob.example.com/profile/card.ttl#me> <http://www.w3.org/ns/pim/space#preferencesFile> <https://bob.example.com/settings/prefs.ttl> .')
170170

171-
const preferencesPatch = requests.find(req => req.method === 'PATCH' && req.url === 'https://bob.example.com/Settings/prefs.ttl')
171+
const preferencesPatch = requests.find(req => req.method === 'PATCH' && req.url === 'https://bob.example.com/settings/prefs.ttl')
172172
expect(preferencesPatch).toBeDefined()
173173
if (!preferencesPatch) {
174174
throw new Error('Expected preferences patch request for bob')
175175
}
176176
const preferencesPatchText = await preferencesPatch.text()
177-
expect(preferencesPatchText).toContain('<https://bob.example.com/Settings/prefs.ttl> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/pim/space#ConfigurationFile> .')
178-
expect(preferencesPatchText).toContain('<https://bob.example.com/Settings/prefs.ttl> <http://purl.org/dc/terms/title> "Preferences file" .')
177+
expect(preferencesPatchText).toContain('<https://bob.example.com/settings/prefs.ttl> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/pim/space#ConfigurationFile> .')
178+
expect(preferencesPatchText).toContain('<https://bob.example.com/settings/prefs.ttl> <http://purl.org/dc/terms/title> "Preferences file" .')
179179
expect(preferencesPatchText).toContain('<https://bob.example.com/profile/card.ttl#me> <http://www.w3.org/ns/solid/terms#publicTypeIndex>')
180180
expect(preferencesPatchText).toContain('<https://bob.example.com/profile/card.ttl#me> <http://www.w3.org/ns/solid/terms#privateTypeIndex>')
181181

182182
const putUrls = requests.filter(req => req.method === 'PUT').map(req => req.url)
183-
expect(putUrls).toContain('https://bob.example.com/Settings/')
184-
expect(putUrls).toContain('https://bob.example.com/Settings/.acl')
185-
expect(putUrls).toContain('https://bob.example.com/Settings/prefs.ttl')
186-
expect(putUrls).toContain('https://bob.example.com/Settings/publicTypeIndex.ttl')
187-
expect(putUrls).toContain('https://bob.example.com/Settings/publicTypeIndex.ttl.acl')
188-
expect(putUrls).toContain('https://bob.example.com/Settings/privateTypeIndex.ttl')
183+
expect(putUrls).toContain('https://bob.example.com/settings/')
184+
expect(putUrls).toContain('https://bob.example.com/settings/.acl')
185+
expect(putUrls).toContain('https://bob.example.com/settings/prefs.ttl')
186+
expect(putUrls).toContain('https://bob.example.com/settings/publicTypeIndex.ttl')
187+
expect(putUrls).toContain('https://bob.example.com/settings/publicTypeIndex.ttl.acl')
188+
expect(putUrls).toContain('https://bob.example.com/settings/privateTypeIndex.ttl')
189189

190-
const publicTypeIndexBody = web['https://bob.example.com/Settings/publicTypeIndex.ttl']
190+
const publicTypeIndexBody = web['https://bob.example.com/settings/publicTypeIndex.ttl']
191191
expect(publicTypeIndexBody).toBeDefined()
192192
expect(publicTypeIndexBody).toContain('@prefix solid: <http://www.w3.org/ns/solid/terms#>.')
193193
expect(publicTypeIndexBody).toContain('<>')
194194
expect(publicTypeIndexBody).toContain('a solid:TypeIndex ;')
195195
expect(publicTypeIndexBody).toContain('a solid:ListedDocument.')
196196

197-
const privateTypeIndexBody = web['https://bob.example.com/Settings/privateTypeIndex.ttl']
197+
const privateTypeIndexBody = web['https://bob.example.com/settings/privateTypeIndex.ttl']
198198
expect(privateTypeIndexBody).toBeDefined()
199199
expect(privateTypeIndexBody).toContain('@prefix solid: <http://www.w3.org/ns/solid/terms#>.')
200200
expect(privateTypeIndexBody).toContain('<>')
201201
expect(privateTypeIndexBody).toContain('a solid:TypeIndex ;')
202202
expect(privateTypeIndexBody).toContain('a solid:UnlistedDocument.')
203203

204-
const settingsAclPut = requests.find(req => req.method === 'PUT' && req.url === 'https://bob.example.com/Settings/.acl')
204+
const settingsAclPut = requests.find(req => req.method === 'PUT' && req.url === 'https://bob.example.com/settings/.acl')
205205
expect(settingsAclPut).toBeDefined()
206-
const settingsAclBody = web['https://bob.example.com/Settings/.acl']
206+
const settingsAclBody = web['https://bob.example.com/settings/.acl']
207207
expect(settingsAclBody).toBeDefined()
208208
expect(settingsAclBody).toContain('@prefix acl: <http://www.w3.org/ns/auth/acl#>.')
209209
expect(settingsAclBody).toContain('<#owner>')
@@ -212,9 +212,9 @@ describe('Profile', () => {
212212
expect(settingsAclBody).toContain('acl:default <./>;')
213213
expect(settingsAclBody).toContain('acl:mode acl:Read, acl:Write, acl:Control.')
214214

215-
const publicTypeIndexAclPut = requests.find(req => req.method === 'PUT' && req.url === 'https://bob.example.com/Settings/publicTypeIndex.ttl.acl')
215+
const publicTypeIndexAclPut = requests.find(req => req.method === 'PUT' && req.url === 'https://bob.example.com/settings/publicTypeIndex.ttl.acl')
216216
expect(publicTypeIndexAclPut).toBeDefined()
217-
const publicTypeIndexAclBody = web['https://bob.example.com/Settings/publicTypeIndex.ttl.acl']
217+
const publicTypeIndexAclBody = web['https://bob.example.com/settings/publicTypeIndex.ttl.acl']
218218
expect(publicTypeIndexAclBody).toBeDefined()
219219
expect(publicTypeIndexAclBody).not.toEqual('')
220220
expect(publicTypeIndexAclBody).toContain('@prefix acl: <http://www.w3.org/ns/auth/acl#>.')
@@ -305,44 +305,44 @@ describe('Profile', () => {
305305
throw new Error('Expected profile patch request for boby')
306306
}
307307
const profilePatchText = await profilePatch.text()
308-
expect(profilePatchText).toContain('INSERT DATA { <https://boby.example.com/profile/card.ttl#me> <http://www.w3.org/ns/pim/space#preferencesFile> <https://boby.example.com/Settings/prefs.ttl> .')
308+
expect(profilePatchText).toContain('INSERT DATA { <https://boby.example.com/profile/card.ttl#me> <http://www.w3.org/ns/pim/space#preferencesFile> <https://boby.example.com/settings/prefs.ttl> .')
309309

310-
const preferencesPatch = requests.find(req => req.method === 'PATCH' && req.url === 'https://boby.example.com/Settings/prefs.ttl')
310+
const preferencesPatch = requests.find(req => req.method === 'PATCH' && req.url === 'https://boby.example.com/settings/prefs.ttl')
311311
expect(preferencesPatch).toBeDefined()
312312
if (!preferencesPatch) {
313313
throw new Error('Expected preferences patch request for boby')
314314
}
315315
const preferencesPatchText = await preferencesPatch.text()
316-
expect(preferencesPatchText).toContain('<https://boby.example.com/Settings/prefs.ttl> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/pim/space#ConfigurationFile> .')
317-
expect(preferencesPatchText).toContain('<https://boby.example.com/Settings/prefs.ttl> <http://purl.org/dc/terms/title> "Preferences file" .')
316+
expect(preferencesPatchText).toContain('<https://boby.example.com/settings/prefs.ttl> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/pim/space#ConfigurationFile> .')
317+
expect(preferencesPatchText).toContain('<https://boby.example.com/settings/prefs.ttl> <http://purl.org/dc/terms/title> "Preferences file" .')
318318
expect(preferencesPatchText).toContain('<https://boby.example.com/profile/card.ttl#me> <http://www.w3.org/ns/solid/terms#publicTypeIndex>')
319319
expect(preferencesPatchText).toContain('<https://boby.example.com/profile/card.ttl#me> <http://www.w3.org/ns/solid/terms#privateTypeIndex>')
320320

321321
const putUrls = requests.filter(req => req.method === 'PUT').map(req => req.url)
322-
expect(putUrls).toContain('https://boby.example.com/Settings/')
323-
expect(putUrls).toContain('https://boby.example.com/Settings/.acl')
324-
expect(putUrls).toContain('https://boby.example.com/Settings/prefs.ttl')
325-
expect(putUrls).toContain('https://boby.example.com/Settings/publicTypeIndex.ttl')
326-
expect(putUrls).toContain('https://boby.example.com/Settings/publicTypeIndex.ttl.acl')
327-
expect(putUrls).toContain('https://boby.example.com/Settings/privateTypeIndex.ttl')
322+
expect(putUrls).toContain('https://boby.example.com/settings/')
323+
expect(putUrls).toContain('https://boby.example.com/settings/.acl')
324+
expect(putUrls).toContain('https://boby.example.com/settings/prefs.ttl')
325+
expect(putUrls).toContain('https://boby.example.com/settings/publicTypeIndex.ttl')
326+
expect(putUrls).toContain('https://boby.example.com/settings/publicTypeIndex.ttl.acl')
327+
expect(putUrls).toContain('https://boby.example.com/settings/privateTypeIndex.ttl')
328328

329-
const publicTypeIndexBody = web['https://boby.example.com/Settings/publicTypeIndex.ttl']
329+
const publicTypeIndexBody = web['https://boby.example.com/settings/publicTypeIndex.ttl']
330330
expect(publicTypeIndexBody).toBeDefined()
331331
expect(publicTypeIndexBody).toContain('@prefix solid: <http://www.w3.org/ns/solid/terms#>.')
332332
expect(publicTypeIndexBody).toContain('<>')
333333
expect(publicTypeIndexBody).toContain('a solid:TypeIndex ;')
334334
expect(publicTypeIndexBody).toContain('a solid:ListedDocument.')
335335

336-
const privateTypeIndexBody = web['https://boby.example.com/Settings/privateTypeIndex.ttl']
336+
const privateTypeIndexBody = web['https://boby.example.com/settings/privateTypeIndex.ttl']
337337
expect(privateTypeIndexBody).toBeDefined()
338338
expect(privateTypeIndexBody).toContain('@prefix solid: <http://www.w3.org/ns/solid/terms#>.')
339339
expect(privateTypeIndexBody).toContain('<>')
340340
expect(privateTypeIndexBody).toContain('a solid:TypeIndex ;')
341341
expect(privateTypeIndexBody).toContain('a solid:UnlistedDocument.')
342342

343-
const settingsAclPut = requests.find(req => req.method === 'PUT' && req.url === 'https://boby.example.com/Settings/.acl')
343+
const settingsAclPut = requests.find(req => req.method === 'PUT' && req.url === 'https://boby.example.com/settings/.acl')
344344
expect(settingsAclPut).toBeDefined()
345-
const settingsAclBody = web['https://boby.example.com/Settings/.acl']
345+
const settingsAclBody = web['https://boby.example.com/settings/.acl']
346346
expect(settingsAclBody).toBeDefined()
347347
expect(settingsAclBody).toContain('@prefix acl: <http://www.w3.org/ns/auth/acl#>.')
348348
expect(settingsAclBody).toContain('<#owner>')
@@ -351,9 +351,9 @@ describe('Profile', () => {
351351
expect(settingsAclBody).toContain('acl:default <./>;')
352352
expect(settingsAclBody).toContain('acl:mode acl:Read, acl:Write, acl:Control.')
353353

354-
const publicTypeIndexAclPut = requests.find(req => req.method === 'PUT' && req.url === 'https://boby.example.com/Settings/publicTypeIndex.ttl.acl')
354+
const publicTypeIndexAclPut = requests.find(req => req.method === 'PUT' && req.url === 'https://boby.example.com/settings/publicTypeIndex.ttl.acl')
355355
expect(publicTypeIndexAclPut).toBeDefined()
356-
const publicTypeIndexAclBody = web['https://boby.example.com/Settings/publicTypeIndex.ttl.acl']
356+
const publicTypeIndexAclBody = web['https://boby.example.com/settings/publicTypeIndex.ttl.acl']
357357
expect(publicTypeIndexAclBody).toBeDefined()
358358
expect(publicTypeIndexAclBody).not.toEqual('')
359359
expect(publicTypeIndexAclBody).toContain('@prefix acl: <http://www.w3.org/ns/auth/acl#>.')

test/typeIndexLogic.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ describe('TypeIndex logic NEW', () => {
212212
// Existing behavior that must remain true
213213
expect(byUrlAndMethod('https://bob.example.com/profile/card.ttl', 'PATCH')).toEqual(true)
214214
expect(byUrlAndMethod('https://bob.example.com/profile/publicTypeIndex.ttl', 'PUT')).toEqual(true)
215-
expect(byUrlAndMethod('https://bob.example.com/Settings/prefs.ttl', 'PUT')).toEqual(true)
216-
expect(byUrlAndMethod('https://bob.example.com/Settings/prefs.ttl', 'PATCH')).toEqual(true)
217-
expect(byUrlAndMethod('https://bob.example.com/Settings/privateTypeIndex.ttl', 'PUT')).toEqual(true)
215+
expect(byUrlAndMethod('https://bob.example.com/settings/prefs.ttl', 'PUT')).toEqual(true)
216+
expect(byUrlAndMethod('https://bob.example.com/settings/prefs.ttl', 'PATCH')).toEqual(true)
217+
expect(byUrlAndMethod('https://bob.example.com/settings/privateTypeIndex.ttl', 'PUT')).toEqual(true)
218218

219219
const createdPublicTypeIndexBody = web['https://bob.example.com/profile/publicTypeIndex.ttl']
220220
expect(createdPublicTypeIndexBody).toBeDefined()
@@ -223,16 +223,16 @@ describe('TypeIndex logic NEW', () => {
223223
expect(createdPublicTypeIndexBody).toContain('a solid:TypeIndex ;')
224224
expect(createdPublicTypeIndexBody).toContain('a solid:ListedDocument.')
225225

226-
const createdPrivateTypeIndexBody = web['https://bob.example.com/Settings/privateTypeIndex.ttl']
226+
const createdPrivateTypeIndexBody = web['https://bob.example.com/settings/privateTypeIndex.ttl']
227227
expect(createdPrivateTypeIndexBody).toBeDefined()
228228
expect(createdPrivateTypeIndexBody).toContain('@prefix solid: <http://www.w3.org/ns/solid/terms#>.')
229229
expect(createdPrivateTypeIndexBody).toContain('<>')
230230
expect(createdPrivateTypeIndexBody).toContain('a solid:TypeIndex ;')
231231
expect(createdPrivateTypeIndexBody).toContain('a solid:UnlistedDocument.')
232232

233233
// New ACL/setup behavior
234-
expect(byUrlAndMethod('https://bob.example.com/Settings/', 'PUT')).toEqual(true)
235-
expect(byUrlAndMethod('https://bob.example.com/Settings/.acl', 'PUT')).toEqual(true)
234+
expect(byUrlAndMethod('https://bob.example.com/settings/', 'PUT')).toEqual(true)
235+
expect(byUrlAndMethod('https://bob.example.com/settings/.acl', 'PUT')).toEqual(true)
236236

237237
})
238238
})

0 commit comments

Comments
 (0)