mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #11804 from overleaf/jpa-fix-fs-persistor-nested-layout
[object-persistor] forward settings.useSubdirectories to FSPersistor GitOrigin-RevId: 92cef51c392cfeaebbcca2597740562c1f3fc95f
This commit is contained in:
parent
8a60ae1fae
commit
0b82db0abe
2 changed files with 19 additions and 0 deletions
|
@ -14,6 +14,7 @@ function getPersistor(backend, settings) {
|
|||
)
|
||||
case 'fs':
|
||||
return new FSPersistor({
|
||||
useSubdirectories: settings.useSubdirectories,
|
||||
paths: settings.paths,
|
||||
Metrics: settings.Metrics,
|
||||
})
|
||||
|
|
|
@ -10,6 +10,10 @@ describe('PersistorManager', function () {
|
|||
|
||||
beforeEach(function () {
|
||||
FSPersistor = class {
|
||||
constructor(settings) {
|
||||
this.settings = settings
|
||||
}
|
||||
|
||||
wrappedMethod() {
|
||||
return 'FSPersistor'
|
||||
}
|
||||
|
@ -60,6 +64,20 @@ describe('PersistorManager', function () {
|
|||
expect(PersistorFactory(Settings).wrappedMethod()).to.equal('FSPersistor')
|
||||
})
|
||||
|
||||
it('should forward useSubdirectories=true to FSPersistor', function () {
|
||||
Settings.backend = 'fs'
|
||||
Settings.useSubdirectories = true
|
||||
|
||||
expect(PersistorFactory(Settings).settings.useSubdirectories).to.be.true
|
||||
})
|
||||
|
||||
it('should forward useSubdirectories=false to FSPersistor', function () {
|
||||
Settings.backend = 'fs'
|
||||
Settings.useSubdirectories = false
|
||||
|
||||
expect(PersistorFactory(Settings).settings.useSubdirectories).to.be.false
|
||||
})
|
||||
|
||||
it('should throw an error when the backend is not configured', function () {
|
||||
try {
|
||||
PersistorFactory(Settings)
|
||||
|
|
Loading…
Reference in a new issue