mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-05 23:53:21 +00:00
* Unpackage-ify jslib * Adjust .tsconfig path for root and apply to jslib * Rebuild package-lock.json * Disable husky in CI * Revert an incorrect find/replace * Add jslib/shared/.eslintrc rules to root eslintrc * Revert package.json change to ignore spec files when linting * Ensure custom matcher gets imported in jslib tests * Fix small workflow bugs from merging * Try and get CI builds moving again * Always sign and notorize builds in CI * Revert erroneous verion bump
47 lines
1.0 KiB
TypeScript
47 lines
1.0 KiB
TypeScript
import { SecureNoteType } from "@/jslib/common/src/enums/secureNoteType";
|
|
import { SecureNoteData } from "@/jslib/common/src/models/data/secureNoteData";
|
|
import { SecureNote } from "@/jslib/common/src/models/domain/secureNote";
|
|
|
|
describe("SecureNote", () => {
|
|
let data: SecureNoteData;
|
|
|
|
beforeEach(() => {
|
|
data = {
|
|
type: SecureNoteType.Generic,
|
|
};
|
|
});
|
|
|
|
it("Convert from empty", () => {
|
|
const data = new SecureNoteData();
|
|
const secureNote = new SecureNote(data);
|
|
|
|
expect(secureNote).toEqual({
|
|
type: undefined,
|
|
});
|
|
});
|
|
|
|
it("Convert", () => {
|
|
const secureNote = new SecureNote(data);
|
|
|
|
expect(secureNote).toEqual({
|
|
type: 0,
|
|
});
|
|
});
|
|
|
|
it("toSecureNoteData", () => {
|
|
const secureNote = new SecureNote(data);
|
|
expect(secureNote.toSecureNoteData()).toEqual(data);
|
|
});
|
|
|
|
it("Decrypt", async () => {
|
|
const secureNote = new SecureNote();
|
|
secureNote.type = SecureNoteType.Generic;
|
|
|
|
const view = await secureNote.decrypt(null);
|
|
|
|
expect(view).toEqual({
|
|
type: 0,
|
|
});
|
|
});
|
|
});
|