Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Tests

What the automated tests check, grouped by feature. Use it to review coverage and to find behavior that no test protects. How to run the suites is in CONTRIBUTING.md.

How to use this folder

  • Is a behavior tested? Find its area in the coverage map and open only that file. Each area file lists behaviors, the tests that cover each one per layer, a Not tested line naming the layers without a test, then the area’s Gaps.
  • Not listed means not known to be tested. If a behavior isn’t in its area file, treat it as untested until you’ve checked the tests named there.
  • Nothing tests it at all? Modules and code with no tests are in untested-areas.md.
  • When you add, rename or remove a test, update its entry in the area file and the test files table. When a test closes a gap, remove the gap.

Tests are written as File.testName. Swift tests drop the test prefix here, so NoteEditingUITests.testUndoRemovesTyping is written NoteEditingUITests.UndoRemovesTyping.

Layers

LayerFolderWhat it exercises
Shared, commonapp/sharedLogic/src/commonTestPure rules: Markdown codec, editor session, diff, links, search matching, trail. Runs on JVM, Android host and iOS simulator
Shared, JVMapp/sharedLogic/src/jvmTestNotesCore against an in-memory SQLite (JdbcSqliteDriver): storage, revisions, organizing, export and import; the sync engine between devices through a fake server and through the real server in process (KtorDestination over HTTP)
Android UIapp/androidApp/src/androidTestCompose + Espresso on a device or emulator, empty in-memory database per test
Android integrationapp/androidApp/src/androidTest (ExportIntegrationTest)Export and import end to end on Android SQLite and real files, no UI
Android screenshotsapp/androidApp/src/testRoborazzi + Robolectric on the JVM, compared with src/test/screenshots
iOS UIapp/iosApp/JotryUITestsXCUITest, app launched with -ui-testing (in-memory database)
iOS integrationapp/iosApp/JotryIntegrationTestsExport and import end to end on the iOS core and real files, no UI
iOS snapshotsapp/iosApp/JotrySnapshotTestsswift-snapshot-testing, references recorded on iPhone 17 Pro, iOS 26.5
Crypto, commoncrypto/src/commonTestSync encryption: note keys, record envelopes, QR enrollment wrap, recovery key, signing keys, key vault. Runs on JVM, iOS simulator and an Android device or emulator
Crypto, Androidcrypto/src/androidDeviceTestThe Android Keystore secret store, on a device or emulator
Crypto, iOScrypto/src/iosTestThe Keychain secret store, on a booted iOS simulator
Server, serviceserver/service/src/testThe server’s framework-free logic, and the store contracts on the in-memory stores. Runs on the JVM alone
Server, development buildserver/dev/src/testThe development verifier (D-70), which only a development build contains. Runs on the JVM alone
Server, Postgres adapterserver/postgres/src/testMigrations, the database probe and settings, and the store contracts, on a real Postgres (Testcontainers or JOTRY_TEST_DATABASE_URL), a fresh database per test
Sync APIsyncApi/src/commonTestThe CBOR request and response classes (D-63) and the signed statements (D-68): bytes on the wire, round trips, unknown fields. Run on the JVM, iOS simulator and an Android device or emulator
Server, Ktor adapterserver/src/testHTTP routes and the Koin wiring through Ktor’s test host, and the promo tool’s commands; the wiring test uses a real Postgres
Desktopapp/desktopUi/src/testCompose desktop UI tests (runComposeUiTest, offscreen) and NotesCore on a SQLite file, on the JVM

Coverage map

AreaFileSharedAndroid UIiOS UIMain gaps
Notebooks, pins, moving notesnotebooks-and-organizing.md✅✅✅Android left-edge swipe for the drawer
Editor, formatting, checklists, saving, titleseditor.md✅✅✅Headings and lists in the UI, 10-second autosave, generated titles on devices
Markdown parsing and writingmarkdown.md✅n/an/aMermaid fences, images, deep nesting
Note links, web links, lookup, back and forwardlinks-and-navigation.md✅✅✅Links to trashed notes, tapping web addresses in the read view
History, versions and changeshistory.md✅✅✅Spoken “added/removed”, strike-through
Searchsearch.md✅✅✅Selecting all results
Trash, delete and undotrash.md✅✅✅App closing before Empty trash’s undo bar expires
Markdown export and importexport-import.md✅✅✅Importing single files from Settings, unreadable files
Storage, migration, hashes, orderingstorage.md✅——Only the version 1 migration
Sync encryption (crypto module: keys, envelopes, enrollment, recovery, key storage)sync-crypto.md✅n/an/aWindows and Linux desktop key stores; the D-57 keychain backup
Sync engine and the apps’ sync screens (turning sync on, joining by QR code, outbox, push, pull, merging, delete-versus-edit, root key rotation)sync-engine.md✅✅✅The engine not on Android or iOS; the apps’ status screen and turning sync off; records waiting for their key; how the engine handles refused writes and a read-only group
Sync server and API (health, migrations, groups, entitlements, promo codes, records, device auth, enrollment, recovery, root key rotation, rate limits, maintenance, CBOR)server.mdn/an/an/aReverse QR and the store verifiers are not built; the sync engine calls the auth and record routes only in the shared JVM tests
Desktop window, editor and databasedesktop.mdn/an/an/aThe native binary and the Nucleus window; most formatting; window screens beyond the main flows
Screenshots (visual)screenshots.mdn/a✅✅Android has no empty-search screenshot
No tests at alluntested-areas.mdLocalization, platform text styling, sync contracts and web

Test files

Test fileLayerTestsAreas
commonTest/.../domain/DomainSupportTest.ktShared, common7storage, export-import
commonTest/.../editor/EditorSessionTest.ktShared, common20editor, links-and-navigation
commonTest/.../history/RevisionDiffTest.ktShared, common12history
commonTest/.../links/NoteLinksTest.ktShared, common7links-and-navigation
commonTest/.../markdown/MarkdownCodecTest.ktShared, common12markdown
commonTest/.../navigation/NoteTrailTest.ktShared, common2links-and-navigation
commonTest/.../search/SearchIndexTest.ktShared, common6search
jvmTest/.../NotesCoreTest.ktShared, JVM25storage, history, search, trash, export-import, notebooks-and-organizing, links-and-navigation, editor
jvmTest/.../OrganizingTest.ktShared, JVM10notebooks-and-organizing, editor, links-and-navigation, storage
jvmTest/.../sync/SyncEngineTest.ktShared, JVM14sync-engine
jvmTest/.../sync/SyncFaultTest.ktShared, JVM4sync-engine
jvmTest/.../sync/SyncOnServerTest.ktShared, JVM18sync-engine: SyncEngineTest and SyncFaultTest again, against the real server in process
jvmTest/.../sync/KtorDestinationTest.ktShared, JVM9sync-engine
jvmTest/.../sync/CloudSyncTest.ktShared, JVM9sync-engine
jvmTest/.../sync/EnrollmentTest.ktShared, JVM5sync-engine
jvmTest/.../sync/RootKeyRotationTest.ktShared, JVM10sync-engine
jvmTest/.../sync/LiveSyncServerTest.ktShared, JVM1sync-engine; skipped unless JOTRY_SYNC_SERVER and JOTRY_PROMO_CODE are set
jvmTest/.../sync/FakeSyncServer.kt, SyncTestServer.kt, InProcessSyncServer.kt, HttpSyncGroup.kt, SyncTestDevices.ktShared, JVM0Fixtures: the in-memory server with fault injection, the real server started in process, setting up a group over HTTP (create, QR enrollment), and test devices
androidTest/.../NotebookUiTest.ktAndroid UI12notebooks-and-organizing
androidTest/.../NoteEditingUiTest.ktAndroid UI14editor, links-and-navigation
androidTest/.../HistorySearchTrashUiTest.ktAndroid UI11history, search, trash, export-import (settings text)
androidTest/.../SyncUiTest.ktAndroid UI3sync-engine
androidTest/.../ExportUiTest.ktAndroid UI1export-import
androidTest/.../ImportUiTest.ktAndroid UI1export-import
androidTest/.../ExportIntegrationTest.ktAndroid integration1export-import
androidTest/.../JotryUiTest.ktAndroid UI0Base class: in-memory core, helpers such as typeInBody
androidApp/src/test/.../ScreenshotTest.ktAndroid screenshots12screenshots
JotryUITests/NotebookUITests.swiftiOS UI14notebooks-and-organizing
JotryUITests/NoteEditingUITests.swiftiOS UI14editor, links-and-navigation
JotryUITests/HistorySearchTrashUITests.swiftiOS UI11history, search, trash, export-import (settings text)
JotryUITests/SyncUITests.swiftiOS UI3sync-engine
JotryUITests/ExportUITests.swiftiOS UI1export-import
JotryUITests/ImportUITests.swiftiOS UI1export-import
JotryUITests/JotryUITestCase.swiftiOS UI0Base class: launch with -ui-testing, helpers
JotryIntegrationTests/ExportIntegrationTests.swiftiOS integration2export-import
JotrySnapshotTests/ScreenSnapshotTests.swiftiOS snapshots13screenshots
crypto/.../NoteKeysTest.ktCrypto, common9sync-crypto
crypto/.../DeviceNamesTest.ktCrypto, common6sync-crypto
crypto/.../RecordCipherTest.ktCrypto, common9sync-crypto
crypto/.../DeviceEnrollmentTest.ktCrypto, common7sync-crypto
crypto/.../RecoveryKeyTest.ktCrypto, common12sync-crypto
crypto/.../SigningKeyTest.ktCrypto, common5sync-crypto
crypto/.../KeyVaultTest.ktCrypto, common5sync-crypto
crypto/.../DeviceEncryptionKeyTest.ktCrypto, common5sync-crypto
crypto/src/androidDeviceTest/.../AndroidSecretStoreTest.ktCrypto, Android4sync-crypto
crypto/src/iosTest/.../IosSecretStoreTest.ktCrypto, iOS3sync-crypto
desktopUi/src/test/.../JotryDesktopUiTest.ktDesktop12desktop
desktopUi/src/test/.../DesktopEditorUiTest.ktDesktop5desktop
desktopUi/src/test/.../DatabaseTest.ktDesktop3desktop
desktopUi/src/test/.../LibraryEditorUiTest.ktDesktop (ComposeTextEditor spike)5desktop
desktopUi/src/test/.../DesktopSyncUiTest.ktDesktop5desktop
desktopUi/src/test/.../MacKeychainSecretStoreTest.ktDesktop (macOS only)4desktop
sharedUI/src/commonTest/.../SharedUICommonTest.ktTemplate1Placeholder (example), tests nothing
server/service/src/test/.../HealthServiceTest.ktServer, service4server
server/service/src/test/.../EntitlementPolicyTest.ktServer, service8server
server/service/src/test/.../InMemoryGroupStoreTest.ktServer, service16 (GroupStoreContract)server
server/service/src/test/.../RecordServiceTest.ktServer, service13server
server/service/src/test/.../AuthServiceTest.ktServer, service13server
server/service/src/test/.../EnrollmentServiceTest.ktServer, service6server
server/service/src/test/.../RecoveryServiceTest.ktServer, service6server
server/service/src/test/.../GroupCreationTest.ktServer, service9server
server/service/src/test/.../PurchasesTest.ktServer, service8server
server/service/src/test/.../InMemoryAuthStoreTest.ktServer, service16 (AuthStoreContract)server
server/service/src/test/.../RootKeyServiceTest.ktServer, service13server
server/service/src/test/.../RateLimitTest.ktServer, service9server
server/service/src/test/.../MaintenanceTest.ktServer, service5server
server/service/src/test/.../InMemoryRecordStoreTest.ktServer, service8 (RecordStoreContract)server
server/service/src/test/.../InMemoryPromoStoreTest.ktServer, service10 (PromoStoreContract)server
server/service/src/test/.../PromoTest.ktServer, service8 (PromoCodesTest 3, PromoVerifierTest 5)server
server/postgres/src/test/.../PostgresDatabaseTest.ktServer, Postgres adapter5server
server/postgres/src/test/.../PostgresSettingsTest.ktServer, Postgres adapter3server
server/postgres/src/test/.../PostgresGroupStoreTest.ktServer, Postgres adapter16 (GroupStoreContract)server
server/dev/src/test/.../DevelopmentVerifierTest.ktServer, development build3server
server/postgres/src/test/.../PostgresRecordStoreTest.ktServer, Postgres adapter8 (RecordStoreContract)server
server/postgres/src/test/.../PostgresAuthStoreTest.ktServer, Postgres adapter16 (AuthStoreContract)server
server/postgres/src/test/.../PostgresPromoStoreTest.ktServer, Postgres adapter10 (PromoStoreContract)server
syncApi/src/commonTest/.../SyncApiTest.ktSync API7server
syncApi/src/commonTest/.../SyncStatementsTest.ktSync API7server
server/src/test/.../ApplicationTest.ktServer, Ktor adapter3server (testRoot is the template placeholder)
server/src/test/.../WiringTest.ktServer, Ktor adapter3server
server/src/test/.../SyncRoutesTest.ktServer, Ktor adapter12server
server/src/test/.../PromoToolTest.ktServer, Ktor adapter5server
server/src/test/.../AuthRoutesTest.ktServer, Ktor adapter14server
server/src/test/.../RootKeyRoutesTest.ktServer, Ktor adapter6server
server/src/test/.../RateLimitRoutesTest.ktServer, Ktor adapter12server

Totals: 169 shared tests (66 common, 103 JVM), 43 Android device tests (42 UI, 1 integration), 12 Android screenshots, 46 iOS tests (44 UI, 2 integration), 13 iOS snapshots, 34 desktop tests (27 UI, 3 database, 4 Keychain), 263 server tests (149 service, 57 Postgres adapter, 54 Ktor adapter, 3 development build), 14 sync API tests.