about summary refs log tree commit diff
path: root/src/state/persisted/__tests__/schema.test.ts
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-08-06 00:30:58 +0100
committerGitHub <noreply@github.com>2024-08-06 00:30:58 +0100
commit5bf7f3769d005e7e606e4b10327eb7467f59f0aa (patch)
tree1e1e2d1bb011b25a9153f39d8ba5f2281b0e1105 /src/state/persisted/__tests__/schema.test.ts
parent74b0318d89b5ec4746cd4861f8573ea24c6ccea1 (diff)
downloadvoidsky-5bf7f3769d005e7e606e4b10327eb7467f59f0aa.tar.zst
[Persisted] Fork web and native, make it synchronous on the web (#4872)
* Delete logic for legacy storage

* Delete superfluous tests

At this point these tests aren't testing anything useful, let's just get rid of them.

* Inline store.ts methods into persisted/index.ts

* Fork persisted/index.ts into index.web.ts

* Remove non-essential code and comments from both forks

* Remove async/await from web fork of persisted/index.ts

* Remove unused return

* Enforce that forked types match
Diffstat (limited to 'src/state/persisted/__tests__/schema.test.ts')
-rw-r--r--src/state/persisted/__tests__/schema.test.ts21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/state/persisted/__tests__/schema.test.ts b/src/state/persisted/__tests__/schema.test.ts
deleted file mode 100644
index c78a2c27c..000000000
--- a/src/state/persisted/__tests__/schema.test.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import {expect, test} from '@jest/globals'
-
-import {transform} from '#/state/persisted/legacy'
-import {defaults, schema} from '#/state/persisted/schema'
-import * as fixtures from '#/state/persisted/__tests__/fixtures'
-
-test('defaults', () => {
-  expect(() => schema.parse(defaults)).not.toThrow()
-})
-
-test('transform', () => {
-  const data = transform({})
-  expect(() => schema.parse(data)).not.toThrow()
-})
-
-test('transform: legacy fixture', () => {
-  const data = transform(fixtures.LEGACY_DATA_DUMP)
-  expect(() => schema.parse(data)).not.toThrow()
-  expect(data.session.currentAccount?.did).toEqual(fixtures.ALICE_DID)
-  expect(data.session.accounts.length).toEqual(2)
-})