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:
parent
3a1aadc90c
commit
830c6babb9
@ -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;
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user