Skip to content

Commit

Permalink
fix(server): unit test for creating tag with color (#15120)
Browse files Browse the repository at this point in the history
* Pass color to tag repo on creation

* unit test for creating tag with optional color
  • Loading branch information
scottdesilva authored Jan 6, 2025
1 parent c78e9d6 commit 1f0ffd6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server/src/services/tag.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 1f0ffd6

Please sign in to comment.