feat: demo mode + demo end-to-end tests
- built-in mock Gitea backend (src/core/demo): repositories, issues, comments, reactions, labels/milestones, pulls, files, diff, reviews, inline comments, releases, notifications, activity, Actions runs/jobs/logs/artifacts/workflows, repo settings, orgs/teams/packages/credentials/admin, and benign writes - session wires demoFetch for the demo instance; welcome screen 'Try the demo' - demo E2E (16 tests over the real endpoint layer) + UI render E2E; minimal reanimated jest mock; README demo-mode section
This commit is contained in:
1 parent
fbefa0d345
commit
1ee0f95b3f
10 files changed
+943
-5
No files matched your search
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Demo mode helpers.
|
||||
*
|
||||
* Starting the demo registers a local instance whose API calls are served by
|
||||
* {@link demoFetch} — no network and no credentials required.
|
||||
*/
|
||||
|
||||
import { useAccountsStore } from '@/core/accounts/accounts-store';
|
||||
|
||||
import { DEMO_BASE_URL, DEMO_LOGIN, DEMO_TOKEN } from './demo-fetch';
|
||||
|
||||
export { demoFetch, isDemoBaseUrl, DEMO_BASE_URL, DEMO_HOST, DEMO_TOKEN, DEMO_LOGIN } from './demo-fetch';
|
||||
|
||||
/** Registers the built-in demo instance and makes it the active account. */
|
||||
export async function startDemoAccount(): Promise<void> {
|
||||
await useAccountsStore.getState().registerAccount({
|
||||
baseUrl: DEMO_BASE_URL,
|
||||
label: 'Demo',
|
||||
token: DEMO_TOKEN,
|
||||
version: '1.22.0',
|
||||
profile: { login: DEMO_LOGIN, id: 1, fullName: 'Octo Cat' },
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user