Files
Checkmate/Server/tests/utils/messages.test.js
T

31 lines
1.0 KiB
JavaScript
Raw Normal View History

2024-10-17 13:09:50 +08:00
import { errorMessages, successMessages } from "../../utils/messages.js";
2025-01-28 00:09:56 +03:00
describe("Messages", function () {
describe("messages - errorMessages", function () {
it("should have a DB_FIND_MONITOR_BY_ID function", function () {
2024-10-17 13:09:50 +08:00
const monitorId = "12345";
2025-01-28 00:09:56 +03:00
const mockLanguage = 'en';
expect(errorMessages.DB_FIND_MONITOR_BY_ID(monitorId, mockLanguage)).to.equal(
2024-10-17 13:09:50 +08:00
`Monitor with id ${monitorId} not found`
);
});
2025-01-28 00:09:56 +03:00
it("should have a DB_DELETE_CHECKS function", function () {
2024-10-17 13:09:50 +08:00
const monitorId = "12345";
2025-01-28 00:09:56 +03:00
const mockLanguage = 'en';
expect(errorMessages.DB_DELETE_CHECKS(monitorId, mockLanguage)).to.equal(
2024-10-17 13:09:50 +08:00
`No checks found for monitor with id ${monitorId}`
);
});
});
2025-01-28 00:09:56 +03:00
describe("messages - successMessages", function () {
it("should have a MONITOR_GET_BY_USER_ID function", function () {
2024-10-17 13:09:50 +08:00
const userId = "12345";
expect(successMessages.MONITOR_GET_BY_USER_ID(userId)).to.equal(
`Got monitor for ${userId} successfully"`
);
});
// Add more tests for other success messages as needed
});
});