Do not allow empty names on request
This commit is contained in:
parent
752790f3c9
commit
1b44f8b18b
|
@ -1 +1 @@
|
|||
Subproject commit 151e785f0ac38054f3930ca4b04e191a31c733f5
|
||||
Subproject commit 124280d24ff60446c166a005e3cc09c986565bb3
|
|
@ -32,6 +32,22 @@ describe("/api/global/groups", () => {
|
|||
'Invalid body - "name" is required'
|
||||
)
|
||||
})
|
||||
|
||||
it("should not allow empty names", async () => {
|
||||
const group = { ...structures.groups.UserGroup(), name: "" }
|
||||
const response = await config.api.groups.saveGroup(group, { expect: 400 })
|
||||
expect(JSON.parse(response.text).message).toEqual(
|
||||
'Invalid body - "name" is not allowed to be empty'
|
||||
)
|
||||
})
|
||||
|
||||
it("should not allow whitespace names", async () => {
|
||||
const group = { ...structures.groups.UserGroup(), name: " " }
|
||||
const response = await config.api.groups.saveGroup(group, { expect: 400 })
|
||||
expect(JSON.parse(response.text).message).toEqual(
|
||||
'Invalid body - "name" is not allowed to be empty'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe("update", () => {
|
||||
|
|
Loading…
Reference in New Issue