1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-05 05:17:40 +02:00

[PM-6426] Adjusting jest tests

This commit is contained in:
Cesar Gonzalez 2024-05-02 11:30:57 -05:00
parent 3a1aadc90c
commit 830c6babb9
No known key found for this signature in database
GPG Key ID: 3381A5457F8CCECF
2 changed files with 19 additions and 0 deletions

View File

@ -242,6 +242,17 @@ describe("BrowserTaskSchedulerService", () => {
});
describe("setInterval", () => {
it("triggers an error when setting an interval for a task that is not registered", async () => {
await expect(
browserTaskSchedulerService.setInterval(
ScheduledTaskNames.notificationsReconnectTimeout,
1000,
),
).rejects.toThrowError(
`Task handler for ${ScheduledTaskNames.notificationsReconnectTimeout} not registered. Unable to schedule task.`,
);
});
describe("setting an interval that is less than 1 minute", () => {
const intervalInMs = 10000;

View File

@ -44,6 +44,14 @@ describe("DefaultTaskSchedulerService", () => {
);
});
it("triggers an error when setting an interval for a task that is not registered", async () => {
await expect(
taskSchedulerService.setInterval(ScheduledTaskNames.notificationsReconnectTimeout, 1000),
).rejects.toThrowError(
`Task handler for ${ScheduledTaskNames.notificationsReconnectTimeout} not registered. Unable to schedule task.`,
);
});
it("overrides the handler for a previously registered task and provides a warning about the task registration", () => {
taskSchedulerService.registerTaskHandler(
ScheduledTaskNames.loginStrategySessionTimeout,