1
0
Fork 0
mirror of synced 2024-10-04 03:54:37 +13:00

Test name trimming

This commit is contained in:
Adria Navarro 2023-05-08 12:45:30 +02:00
parent 1b44f8b18b
commit cd47bc20a2

View file

@ -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", () => {