purge unused groups route, update tests
This commit is contained in:
1 parent
5433a0cf5f
commit
4d9e5821a8
7 files changed
-43
No files matched your search
@@ -18,7 +18,6 @@ const createMonitorsRepositoryMock = () =>
|
||||
findByIds: jest.fn(),
|
||||
findMonitorCountByTeamIdAndType: jest.fn(),
|
||||
findMonitorsSummaryByTeamId: jest.fn(),
|
||||
findGroupsByTeamId: jest.fn(),
|
||||
updateById: jest.fn(),
|
||||
updateNotifications: jest.fn(),
|
||||
togglePauseById: jest.fn(),
|
||||
@@ -746,18 +745,6 @@ describe("MonitorService", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("getGroupsByTeamId", () => {
|
||||
it("delegates to repository", async () => {
|
||||
const monitorsRepository = createMonitorsRepositoryMock();
|
||||
(monitorsRepository.findGroupsByTeamId as jest.Mock).mockResolvedValue(["group1", "group2"]);
|
||||
const { service } = createService({ monitorsRepository });
|
||||
|
||||
const result = await service.getGroupsByTeamId({ teamId: TEAM_ID });
|
||||
expect(result).toEqual(["group1", "group2"]);
|
||||
expect(monitorsRepository.findGroupsByTeamId).toHaveBeenCalledWith(TEAM_ID);
|
||||
});
|
||||
});
|
||||
|
||||
describe("editMonitor", () => {
|
||||
it("updates monitor and refreshes job", async () => {
|
||||
const monitorsRepository = createMonitorsRepositoryMock();
|
||||
|
||||
Reference in new issue
Block a user