chore: fix uuid generation for importers

This commit is contained in:
Mo
2023-08-07 05:06:11 -05:00
parent cedd8e1006
commit ee473fe34d
17 changed files with 94 additions and 47 deletions

View File

@@ -4,13 +4,18 @@
import { jsonTestData, htmlTestData } from './testData'
import { GoogleKeepConverter } from './GoogleKeepConverter'
import { UuidGenerator } from '@standardnotes/utils'
UuidGenerator.SetGenerator(() => String(Math.random()))
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
import { GenerateUuid } from '@standardnotes/services'
describe('GoogleKeepConverter', () => {
const crypto = {
generateUUID: () => String(Math.random()),
} as unknown as PureCryptoInterface
const generateUuid = new GenerateUuid(crypto)
it('should parse json data', () => {
const converter = new GoogleKeepConverter()
const converter = new GoogleKeepConverter(generateUuid)
const result = converter.tryParseAsJson(jsonTestData)
@@ -27,7 +32,7 @@ describe('GoogleKeepConverter', () => {
})
it('should parse html data', () => {
const converter = new GoogleKeepConverter()
const converter = new GoogleKeepConverter(generateUuid)
const result = converter.tryParseAsHtml(
htmlTestData,