Skip to content

Desktop app

Database issues

If you’re having issues with the desktop app’s database when running the dev server or installing, try following these steps and doing a clean pnpm install.

Structure

Simplified directory structure:

  • /electron - The “main” process, the backend of the app, with database and system functionality
    • /database
    • /main
    • /preload - Preload script for IPC
  • /src - the “renderer” process, this is our react frontend.
    • /components - In here you find all the components of OpenMarch, the sidebars, titlebar, dialogs, UI component primitives. All of them are in their subfolder.
    • /context - React Context for the app of some sort of state/value
    • /global - Classes, objects and functions for various items in the app, such as Page, Marcher, MarcherShape, etc.
    • /stores - Global stores for certain items and actions, such as the list of Pages and Marchers
    • App.tsx - the main app file

Most of the directories like stores, context, and database also have a __test__ directory which are used for testing.

Running Tests

Unit tests

Terminal window
pnpm run test

Unit tests with history

These tests simulate a handful of undo/redo operations after each test and assure the database is in the correct state with the right number of undo groups. While these tests run in CI, they disabled by default as they are quite slow. But you can run them like this:

Terminal window
cd apps/desktop
pnpm run test:history

End-to-end (E2E) tests

Terminal window
cd apps/desktop
pnpm run e2e

Generate your own E2E tests

This will launch Playwright’s code generation tool to help you out.

Terminal window
cd apps/desktop
pnpm run e2e:codegen

You can follow the instructions in the E2E testing guide to write your own tests.