mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
add an extra test for invalid element names
This commit is contained in:
parent
2c2b6e5f36
commit
ecea3dd1be
1 changed files with 9 additions and 0 deletions
|
@ -1399,6 +1399,15 @@ describe 'ProjectEntityHandler', ->
|
|||
@ProjectModel.findOneAndUpdate.called.should.equal false
|
||||
done()
|
||||
|
||||
it "should error if element name contains invalid characters", (done)->
|
||||
doc =
|
||||
_id: ObjectId()
|
||||
name: "something*bad"
|
||||
@ProjectEntityHandler._putElement @project, @folder._id, doc, "doc", (err)=>
|
||||
@ProjectModel.findOneAndUpdate.called.should.equal false
|
||||
err.should.deep.equal new Errors.InvalidNameError("invalid element name")
|
||||
done()
|
||||
|
||||
it "should error if element name is too long", (done)->
|
||||
doc =
|
||||
_id: ObjectId()
|
||||
|
|
Loading…
Reference in a new issue