mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 13:49:00 +02:00
Trim the project name again after fixing (#15682)
GitOrigin-RevId: 74c87ee1689668a058a162a1f456815e0748b049
This commit is contained in:
@@ -193,6 +193,8 @@ function fixProjectName(name) {
|
||||
if (name.length > MAX_PROJECT_NAME_LENGTH) {
|
||||
name = name.substr(0, MAX_PROJECT_NAME_LENGTH)
|
||||
}
|
||||
// Remove any leading or trailing whitespace after fixing
|
||||
name = name.trim()
|
||||
return name
|
||||
}
|
||||
|
||||
|
||||
@@ -439,6 +439,12 @@ describe('ProjectDetailsHandler', function () {
|
||||
it('should accept normal names', function () {
|
||||
expect(this.handler.fixProjectName('foobar')).to.equal('foobar')
|
||||
})
|
||||
|
||||
it('should trim name after truncation', function () {
|
||||
expect(this.handler.fixProjectName('a'.repeat(149) + ' a')).to.equal(
|
||||
'a'.repeat(149)
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('setPublicAccessLevel', function () {
|
||||
|
||||
Reference in New Issue
Block a user