Test name trimming
This commit is contained in:
parent
1b44f8b18b
commit
cd47bc20a2
|
@ -13,6 +13,7 @@ describe("/api/global/groups", () => {
|
|||
})
|
||||
|
||||
beforeEach(async () => {
|
||||
jest.resetAllMocks()
|
||||
mocks.licenses.useGroups()
|
||||
})
|
||||
|
||||
|
@ -48,6 +49,14 @@ describe("/api/global/groups", () => {
|
|||
'Invalid body - "name" is not allowed to be empty'
|
||||
)
|
||||
})
|
||||
|
||||
it("should trim names", async () => {
|
||||
const group = { ...structures.groups.UserGroup(), name: " group name " }
|
||||
await config.api.groups.saveGroup(group)
|
||||
expect(events.group.created).toBeCalledWith(
|
||||
expect.objectContaining({ name: "group name" })
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe("update", () => {
|
||||
|
|
Loading…
Reference in New Issue