mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 05:43:41 +00:00
* remove 2fa from main.background * remove login strategy service from main.background * move 2fa and login strategy service to popup, init in browser * add state providers to 2fa service - add deserializer helpers * use key definitions for global state * fix calls to 2fa service * remove extra await * add delay to wait for active account emission in popup * add and fix tests * fix cli * really fix cli * remove timeout and wait for active account * verify expected user is active account * fix tests * address feedback
26 lines
675 B
TypeScript
26 lines
675 B
TypeScript
import { record } from "./deserialization-helpers";
|
|
|
|
describe("deserialization helpers", () => {
|
|
describe("record", () => {
|
|
it("deserializes a record when keys are strings", () => {
|
|
const deserializer = record((value: number) => value);
|
|
const input = {
|
|
a: 1,
|
|
b: 2,
|
|
};
|
|
const output = deserializer(input);
|
|
expect(output).toEqual(input);
|
|
});
|
|
|
|
it("deserializes a record when keys are numbers", () => {
|
|
const deserializer = record((value: number) => value);
|
|
const input = {
|
|
1: 1,
|
|
2: 2,
|
|
};
|
|
const output = deserializer(input);
|
|
expect(output).toEqual(input);
|
|
});
|
|
});
|
|
});
|