mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
This reverts commit 38c335d8fb.
This commit is contained in:
@@ -18,37 +18,6 @@ describe("KeyDefinition", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("cleanupDelayMs", () => {
|
||||
it("defaults to 1000ms", () => {
|
||||
const keyDefinition = new KeyDefinition<boolean>(fakeStateDefinition, "fake", {
|
||||
deserializer: (value) => value,
|
||||
});
|
||||
|
||||
expect(keyDefinition).toBeTruthy();
|
||||
expect(keyDefinition.cleanupDelayMs).toBe(1000);
|
||||
});
|
||||
|
||||
it("can be overridden", () => {
|
||||
const keyDefinition = new KeyDefinition<boolean>(fakeStateDefinition, "fake", {
|
||||
deserializer: (value) => value,
|
||||
cleanupDelayMs: 500,
|
||||
});
|
||||
|
||||
expect(keyDefinition).toBeTruthy();
|
||||
expect(keyDefinition.cleanupDelayMs).toBe(500);
|
||||
});
|
||||
|
||||
it.each([0, -1])("throws on 0 or negative (%s)", (testValue: number) => {
|
||||
expect(
|
||||
() =>
|
||||
new KeyDefinition<boolean>(fakeStateDefinition, "fake", {
|
||||
deserializer: (value) => value,
|
||||
cleanupDelayMs: testValue,
|
||||
}),
|
||||
).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe("record", () => {
|
||||
it("runs custom deserializer for each record value", () => {
|
||||
const recordDefinition = KeyDefinition.record<boolean>(fakeStateDefinition, "fake", {
|
||||
|
||||
Reference in New Issue
Block a user