From 1f0ffd634ae5e018129ffd5cac4de1591ca52b0e Mon Sep 17 00:00:00 2001 From: scottdesilva Date: Mon, 6 Jan 2025 14:33:48 -0500 Subject: [PATCH] fix(server): unit test for creating tag with color (#15120) * Pass color to tag repo on creation * unit test for creating tag with optional color --- server/src/services/tag.service.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/src/services/tag.service.spec.ts b/server/src/services/tag.service.spec.ts index 54cef40d042c1..8d54eb31db4aa 100644 --- a/server/src/services/tag.service.spec.ts +++ b/server/src/services/tag.service.spec.ts @@ -90,6 +90,18 @@ describe(TagService.name, () => { value: 'tag-1', }); }); + + it('should create a new tag with optional color', async () => { + tagMock.create.mockResolvedValue(tagStub.color1); + await expect(sut.create(authStub.admin, { name: 'tag-1', color: '#000000' })).resolves.toEqual( + tagResponseStub.color1, + ); + expect(tagMock.create).toHaveBeenCalledWith({ + userId: authStub.admin.user.id, + value: 'tag-1', + color: '#000000', + }); + }); }); describe('update', () => {