Skip to content

Commit d0eed7a

Browse files
committed
[@dhealthdapps/backend] refactor(notifier): remove DappHelper dependency in AlertNotifier
1 parent 3ae6466 commit d0eed7a

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

runtime/backend/src/notifier/listeners/AlertNotifier.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { NotifierFactory } from "../concerns/NotifierFactory";
1919
import { AlertsConfig } from "../../common/models/MonitoringConfig";
2020
import { Notifier } from "../models/Notifier";
2121
import { NotifierType } from "../models/NotifierType";
22-
import { DappHelper } from "../../common/concerns/DappHelper";
2322
import { LogService } from "../../common/services/LogService";
2423

2524
/**
@@ -71,12 +70,10 @@ export class AlertNotifier {
7170
*
7271
* @param {ConfigService} configService
7372
* @param {NotifierFactory} notifierFactory
74-
* @param {DappHelper} dappHelper
7573
*/
7674
constructor(
7775
private readonly configService: ConfigService,
7876
private readonly notifierFactory: NotifierFactory,
79-
private readonly dappHelper: DappHelper,
8077
) {
8178
// get config
8279
this.alertsConfig = this.configService.get<AlertsConfig>("alerts");

runtime/backend/tests/unit/notifier/listeners/AlertNotifier.spec.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ describe("notifier/AlertNotifier", () => {
3838
providers: [
3939
AlertNotifier,
4040
EventEmitter2, // requirement from AlertNotifier
41-
DappHelper, // requirement from AlertNotifier
4241
NotifierFactory, // requirement from AlertNotifier
4342
EmailNotifier, // requirement from AlertNotifier
4443
NetworkService, // requirement from DappHelper
@@ -71,7 +70,6 @@ describe("notifier/AlertNotifier", () => {
7170
service = module.get<AlertNotifier>(AlertNotifier);
7271
configService = module.get<ConfigService>(ConfigService);
7372
notifierFactory = module.get<NotifierFactory>(NotifierFactory);
74-
dappHelper = module.get<DappHelper>(DappHelper);
7573
});
7674

7775
it("should be defined", () => {
@@ -91,9 +89,6 @@ describe("notifier/AlertNotifier", () => {
9189
const notifierSendInternalCall = jest
9290
.spyOn(notifier, "sendInternal")
9391
.mockResolvedValue();
94-
const dappHelperCreateDetailsTableHTMLCall = jest
95-
.spyOn(dappHelper, "createDetailsTableHTML")
96-
.mockReturnValue("test-html-content");
9792
const alertEvent: AlertEvent = AlertEvent.create(
9893
new Date(),
9994
"warn",
@@ -108,7 +103,6 @@ describe("notifier/AlertNotifier", () => {
108103

109104
// assert
110105
expect(configServiceGetCall).toHaveBeenCalledTimes(0);
111-
expect(dappHelperCreateDetailsTableHTMLCall).toHaveBeenCalledTimes(0);
112106
expect(notifierSendInternalCall).toHaveBeenCalledTimes(0);
113107
});
114108

0 commit comments

Comments
 (0)