Skip to content

Commit

Permalink
added tests for GetUnseenBreakTimeNotificationUseCase
Browse files Browse the repository at this point in the history
  • Loading branch information
DerKatsche committed Oct 21, 2024
1 parent eafe708 commit c7dc591
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import GetUnseenBreakTimeNotificationUseCase from "../../../../../../Core/Application/UseCases/Adaptivity/OverallTimeSpent/GetUnseenBreakTimeNotification/GetUnseenBreakTimeNotificationUseCase";
import { shortBreakTimeNotificationContents } from "../../../../../../Core/Domain/BreakTimeNotifications/BreakTimeNotifications";
import { BreakTimeNotificationType } from "../../../../../../Core/Domain/Entities/Adaptivity/BreakTimeNotificationEntity";

describe("GetUnseenBreakTimeNotificationUseCase", () => {
let systemUnderTest: GetUnseenBreakTimeNotificationUseCase;

beforeEach(() => {
systemUnderTest = new GetUnseenBreakTimeNotificationUseCase();
});

test.each([
BreakTimeNotificationType.Short,
BreakTimeNotificationType.Medium,
BreakTimeNotificationType.Long,
])("returns a BreakTimeNotification for %p", (type) => {
const result = systemUnderTest.internalExecute(type);

expect(shortBreakTimeNotificationContents).toContain(result);
});

test("sets notification.seenBefore true", () => {
const result = systemUnderTest.internalExecute(
BreakTimeNotificationType.Short,
);

expect(result.seenBefore).toBe(true);
});
});

0 comments on commit c7dc591

Please sign in to comment.