mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-15 09:42:30 +00:00
Merge pull request #10888 from overleaf/bg-case-sensitive-delete
Make dropbox deletes case-sensitive GitOrigin-RevId: 090112ce82e38f15079053952db4b0a1544e8300
This commit is contained in:
parent
e433acfc49
commit
2cc2da18a5
3 changed files with 19 additions and 2 deletions
|
@ -1163,7 +1163,7 @@ const ProjectEntityUpdateHandler = {
|
||||||
deleteEntityWithPath: wrapWithLock(
|
deleteEntityWithPath: wrapWithLock(
|
||||||
(projectId, path, userId, source, callback) =>
|
(projectId, path, userId, source, callback) =>
|
||||||
ProjectLocator.findElementByPath(
|
ProjectLocator.findElementByPath(
|
||||||
{ project_id: projectId, path },
|
{ project_id: projectId, path, exactCaseMatch: true },
|
||||||
(err, element, type) => {
|
(err, element, type) => {
|
||||||
if (err != null) {
|
if (err != null) {
|
||||||
return callback(err)
|
return callback(err)
|
||||||
|
|
|
@ -1632,7 +1632,11 @@ describe('ProjectEntityUpdateHandler', function () {
|
||||||
|
|
||||||
it('finds the entity', function () {
|
it('finds the entity', function () {
|
||||||
this.ProjectLocator.findElementByPath
|
this.ProjectLocator.findElementByPath
|
||||||
.calledWith({ project_id: projectId, path: this.path })
|
.calledWith({
|
||||||
|
project_id: projectId,
|
||||||
|
path: this.path,
|
||||||
|
exactCaseMatch: true,
|
||||||
|
})
|
||||||
.should.equal(true)
|
.should.equal(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -400,6 +400,19 @@ describe('ProjectLocator', function () {
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should not return elements with a case-insensitive match when exactCaseMatch is true', function (done) {
|
||||||
|
const path = `${subFolder.name.toUpperCase()}/${secondSubFolder.name.toUpperCase()}/${subSubFile.name.toUpperCase()}`
|
||||||
|
this.locator.findElementByPath(
|
||||||
|
{ project, path, exactCaseMatch: true },
|
||||||
|
(err, element, type, folder) => {
|
||||||
|
err.should.not.equal(undefined)
|
||||||
|
expect(element).to.be.undefined
|
||||||
|
expect(type).to.be.undefined
|
||||||
|
done()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
it('should take a file path and return the element for a nested folder', function (done) {
|
it('should take a file path and return the element for a nested folder', function (done) {
|
||||||
const path = `${subFolder.name}/${secondSubFolder.name}`
|
const path = `${subFolder.name}/${secondSubFolder.name}`
|
||||||
this.locator.findElementByPath(
|
this.locator.findElementByPath(
|
||||||
|
|
Loading…
Reference in a new issue