@1agh/maude 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/apps/studio/acp/bridge.ts +285 -0
- package/apps/studio/acp/env.ts +48 -0
- package/apps/studio/acp/index.ts +132 -0
- package/apps/studio/acp/probe.ts +112 -0
- package/apps/studio/acp/transcript.ts +149 -0
- package/apps/studio/ai-banner.tsx +0 -1
- package/apps/studio/annotations-align.ts +149 -0
- package/apps/studio/annotations-bindings.ts +197 -0
- package/apps/studio/annotations-context-toolbar.tsx +436 -186
- package/apps/studio/annotations-groups.ts +270 -0
- package/apps/studio/annotations-layer.tsx +1714 -1661
- package/apps/studio/annotations-model.ts +2077 -0
- package/apps/studio/annotations-snap.ts +125 -0
- package/apps/studio/api.ts +433 -182
- package/apps/studio/bin/_png-playwright.mjs +1 -1
- package/apps/studio/bin/annotate.mjs +732 -0
- package/apps/studio/bin/annotate.sh +17 -0
- package/apps/studio/bin/chat-open.sh +44 -0
- package/apps/studio/bin/read-annotations.mjs +152 -17
- package/apps/studio/build.ts +1 -1
- package/apps/studio/canvas-arrowheads.ts +78 -9
- package/apps/studio/canvas-cursors.ts +2 -0
- package/apps/studio/canvas-edit.ts +257 -7
- package/apps/studio/canvas-icons.tsx +105 -0
- package/apps/studio/canvas-lib.tsx +112 -19
- package/apps/studio/canvas-list-watch.ts +177 -0
- package/apps/studio/canvas-shell.tsx +326 -9
- package/apps/studio/client/app.jsx +3579 -250
- package/apps/studio/client/canvas-url.js +5 -0
- package/apps/studio/client/github.js +99 -0
- package/apps/studio/client/index.html +1 -1
- package/apps/studio/client/panels/ChatPanel.jsx +770 -0
- package/apps/studio/client/panels/CollabModelInfographic.jsx +71 -0
- package/apps/studio/client/panels/CreateProject.jsx +334 -0
- package/apps/studio/client/panels/DiffView.jsx +590 -0
- package/apps/studio/client/panels/GitPanel.jsx +767 -0
- package/apps/studio/client/panels/IdentityBar.jsx +294 -0
- package/apps/studio/client/panels/OnboardingWizard.jsx +563 -0
- package/apps/studio/client/panels/RepoBranchSwitcher.jsx +349 -0
- package/apps/studio/client/panels/acp-runtime.js +286 -0
- package/apps/studio/client/panels/chat-markdown.jsx +138 -0
- package/apps/studio/client/panels/git-grouping.js +86 -0
- package/apps/studio/client/styles/0-reset.css +4 -0
- package/apps/studio/client/styles/3-shell-maude.css +1326 -14
- package/apps/studio/client/styles/4-components.css +39 -0
- package/apps/studio/client/styles/5-maude-overrides.css +41 -2
- package/apps/studio/client/styles/6-acp-chat.css +771 -0
- package/apps/studio/client/styles/_index.css +2 -0
- package/apps/studio/client/tour/collab-tour.js +61 -0
- package/apps/studio/client/tour/overlay.jsx +116 -18
- package/apps/studio/client/tour/usage-tour.js +23 -10
- package/apps/studio/client/whats-new.jsx +25 -10
- package/apps/studio/collab/registry.ts +13 -0
- package/apps/studio/collab/room.ts +36 -0
- package/apps/studio/commands/annotation-strokes-command.ts +1 -1
- package/apps/studio/commands/move-artboards-command.ts +1 -1
- package/apps/studio/comments-overlay.tsx +7 -5
- package/apps/studio/context-menu.tsx +4 -3
- package/apps/studio/contextual-toolbar.tsx +14 -0
- package/apps/studio/cursors-overlay.tsx +37 -21
- package/apps/studio/dist/client.bundle.js +31795 -1829
- package/apps/studio/dist/comment-mount.js +97 -9
- package/apps/studio/dist/styles.css +7938 -1599
- package/apps/studio/dom-selection.ts +115 -0
- package/apps/studio/export-dialog.tsx +3 -3
- package/apps/studio/git/endpoints.ts +338 -0
- package/apps/studio/git/service.ts +1334 -0
- package/apps/studio/git/watch.ts +97 -0
- package/apps/studio/github/endpoints.ts +358 -0
- package/apps/studio/github/service.ts +231 -0
- package/apps/studio/github/token.ts +53 -0
- package/apps/studio/history.ts +20 -3
- package/apps/studio/hmr-broadcast.ts +9 -2
- package/apps/studio/http.ts +508 -6
- package/apps/studio/input-router.tsx +7 -0
- package/apps/studio/inspect.ts +37 -8
- package/apps/studio/participants-chrome.tsx +70 -16
- package/apps/studio/paths.ts +12 -0
- package/apps/studio/scaffold-design.ts +57 -0
- package/apps/studio/server.ts +70 -4
- package/apps/studio/sync/agent.ts +311 -57
- package/apps/studio/sync/codec.ts +69 -0
- package/apps/studio/sync/cold-start.ts +198 -0
- package/apps/studio/sync/connection-state.ts +58 -2
- package/apps/studio/sync/hub-link.ts +137 -0
- package/apps/studio/sync/index.ts +563 -221
- package/apps/studio/sync/journal.ts +190 -0
- package/apps/studio/sync/migrate-seed.ts +202 -44
- package/apps/studio/sync/projection.ts +22 -3
- package/apps/studio/sync/status.ts +15 -4
- package/apps/studio/test/acp-bridge.test.ts +127 -0
- package/apps/studio/test/acp-env.test.ts +65 -0
- package/apps/studio/test/acp-origin-gate.test.ts +78 -0
- package/apps/studio/test/acp-transcript.test.ts +112 -0
- package/apps/studio/test/activity.test.ts +1 -7
- package/apps/studio/test/annotate-write.test.ts +184 -0
- package/apps/studio/test/annotations-align.test.ts +88 -0
- package/apps/studio/test/annotations-bindings.test.ts +124 -0
- package/apps/studio/test/annotations-groups.test.ts +231 -0
- package/apps/studio/test/annotations-snap.test.ts +79 -0
- package/apps/studio/test/canvas-create-api.test.ts +72 -0
- package/apps/studio/test/canvas-edit.test.ts +181 -1
- package/apps/studio/test/canvas-list-watch.test.ts +322 -0
- package/apps/studio/test/canvas-meta-api.test.ts +161 -27
- package/apps/studio/test/canvas-origin-gate.test.ts +43 -0
- package/apps/studio/test/chat-markdown.test.tsx +58 -0
- package/apps/studio/test/collab-bridge.test.ts +0 -2
- package/apps/studio/test/collab-room.test.ts +2 -7
- package/apps/studio/test/collab-session-survival.test.tsx +176 -0
- package/apps/studio/test/csp-canvas-shell.test.ts +5 -0
- package/apps/studio/test/csrf-write-guard.test.ts +78 -0
- package/apps/studio/test/editing-presence.test.ts +103 -0
- package/apps/studio/test/figjam-v3-model.test.ts +342 -0
- package/apps/studio/test/fixtures/figjam-v3-groups-bindings.svg +1 -0
- package/apps/studio/test/fixtures/mock-acp-agent.mjs +45 -0
- package/apps/studio/test/git-api.test.ts +0 -0
- package/apps/studio/test/git-branches.test.ts +106 -0
- package/apps/studio/test/git-grouping.test.ts +106 -0
- package/apps/studio/test/git-watch.test.ts +97 -0
- package/apps/studio/test/github-api.test.ts +465 -0
- package/apps/studio/test/hub-link.test.ts +69 -0
- package/apps/studio/test/participants-chrome.test.ts +36 -1
- package/apps/studio/test/shared-doc-migrate.test.ts +224 -14
- package/apps/studio/test/sync-agent.test.ts +272 -2
- package/apps/studio/test/sync-codec.test.ts +65 -0
- package/apps/studio/test/sync-cold-seed-dedup.test.ts +187 -0
- package/apps/studio/test/sync-cold-start.test.ts +304 -0
- package/apps/studio/test/sync-connection-state.test.ts +68 -0
- package/apps/studio/test/sync-hardening.test.ts +0 -8
- package/apps/studio/test/sync-hubs-config.test.ts +0 -1
- package/apps/studio/test/sync-incident-replay.test.ts +211 -0
- package/apps/studio/test/sync-journal.test.ts +176 -0
- package/apps/studio/test/sync-runtime.test.ts +360 -5
- package/apps/studio/test/sync-status.test.ts +66 -0
- package/apps/studio/test/tour-overlay.test.tsx +18 -0
- package/apps/studio/test/use-annotation-resize.test.ts +159 -0
- package/apps/studio/test/use-artboard-drag.test.ts +0 -1
- package/apps/studio/test/use-collab.test.ts +0 -0
- package/apps/studio/test/use-tool-mode.test.tsx +5 -2
- package/apps/studio/tool-palette.tsx +30 -11
- package/apps/studio/undo-hud.tsx +0 -1
- package/apps/studio/use-agent-presence.tsx +4 -2
- package/apps/studio/use-annotation-resize.tsx +484 -54
- package/apps/studio/use-annotation-selection.tsx +16 -4
- package/apps/studio/use-canvas-activity.tsx +2 -2
- package/apps/studio/use-chrome-visibility.tsx +66 -0
- package/apps/studio/use-collab.tsx +434 -202
- package/apps/studio/use-selection-set.tsx +9 -0
- package/apps/studio/use-tool-mode.tsx +5 -1
- package/apps/studio/whats-new.json +208 -10
- package/apps/studio/whats-new.schema.json +18 -2
- package/apps/studio/ws.ts +44 -1
- package/cli/commands/design-link.test.mjs +84 -0
- package/cli/commands/design.mjs +3 -1
- package/cli/commands/design.test.mjs +5 -1
- package/cli/lib/design-link.mjs +51 -1
- package/cli/lib/gitignore-block.mjs +16 -3
- package/cli/lib/gitignore-block.test.mjs +13 -1
- package/package.json +11 -9
- package/plugins/design/dependencies.json +17 -0
- package/plugins/design/templates/_shell.html +58 -12
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
// Phase 28 (epic E3) — GitHub service + token-bridge tests.
|
|
2
|
+
//
|
|
3
|
+
// Layers (mirrors git-api.test.ts):
|
|
4
|
+
// (1) request CONSTRUCTION + error MAPPING via a stubbed global `fetch` — proves
|
|
5
|
+
// the auth header / API-version / method / body shape and the non-technical
|
|
6
|
+
// error copy, no network;
|
|
7
|
+
// (2) `setRemote` against a REAL local iso-git repo — no network;
|
|
8
|
+
// (3) the loopback token bridge fetch (token.ts) with a stubbed fetch + env;
|
|
9
|
+
// (4) a guarded REAL-account pass (skipped unless MAUDE_GH_TEST_TOKEN is set) —
|
|
10
|
+
// the "auth shape matters" check the plan calls for, runnable by the user
|
|
11
|
+
// with a scratch token.
|
|
12
|
+
|
|
13
|
+
import { afterEach, describe, expect, test } from 'bun:test';
|
|
14
|
+
import fs, { mkdirSync, mkdtempSync, rmSync } from 'node:fs';
|
|
15
|
+
import { tmpdir } from 'node:os';
|
|
16
|
+
import { join } from 'node:path';
|
|
17
|
+
import git from 'isomorphic-git';
|
|
18
|
+
import type { Context } from '../context.ts';
|
|
19
|
+
import { createGitHubEndpoints, __testing as epTesting } from '../github/endpoints.ts';
|
|
20
|
+
import {
|
|
21
|
+
createRepo,
|
|
22
|
+
GitHubApiError,
|
|
23
|
+
getIdentity,
|
|
24
|
+
inviteCollaborator,
|
|
25
|
+
listUserRepos,
|
|
26
|
+
setRemote,
|
|
27
|
+
} from '../github/service.ts';
|
|
28
|
+
import { getGithubToken, tokenBridgeAvailable } from '../github/token.ts';
|
|
29
|
+
import { hasDesign } from '../scaffold-design.ts';
|
|
30
|
+
|
|
31
|
+
// ── fetch stub harness ───────────────────────────────────────────────────────
|
|
32
|
+
const realFetch = globalThis.fetch;
|
|
33
|
+
type Capture = { url: string; init: RequestInit | undefined };
|
|
34
|
+
function stubFetch(handler: (url: string, init?: RequestInit) => Response): Capture[] {
|
|
35
|
+
const calls: Capture[] = [];
|
|
36
|
+
globalThis.fetch = (async (input: string | URL | Request, init?: RequestInit) => {
|
|
37
|
+
const url = typeof input === 'string' ? input : input.toString();
|
|
38
|
+
calls.push({ url, init });
|
|
39
|
+
return handler(url, init);
|
|
40
|
+
}) as typeof fetch;
|
|
41
|
+
return calls;
|
|
42
|
+
}
|
|
43
|
+
afterEach(() => {
|
|
44
|
+
globalThis.fetch = realFetch;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
function json(body: unknown, status = 200): Response {
|
|
48
|
+
return new Response(JSON.stringify(body), {
|
|
49
|
+
status,
|
|
50
|
+
headers: { 'content-type': 'application/json' },
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ── (1) request construction + error mapping ───────────────────────────────────
|
|
55
|
+
describe('GitHub REST request construction', () => {
|
|
56
|
+
test('getIdentity sends Bearer auth + API version, shapes the profile', async () => {
|
|
57
|
+
const calls = stubFetch(() =>
|
|
58
|
+
json({ login: 'octocat', name: 'Octo Cat', avatar_url: 'https://x/y.png' })
|
|
59
|
+
);
|
|
60
|
+
const id = await getIdentity('tok_abc');
|
|
61
|
+
expect(id).toEqual({ login: 'octocat', name: 'Octo Cat', avatar_url: 'https://x/y.png' });
|
|
62
|
+
expect(calls[0].url).toBe('https://api.github.com/user');
|
|
63
|
+
const headers = calls[0].init?.headers as Record<string, string>;
|
|
64
|
+
expect(headers.Authorization).toBe('Bearer tok_abc');
|
|
65
|
+
expect(headers['X-GitHub-Api-Version']).toBe('2022-11-28');
|
|
66
|
+
expect(headers.Accept).toBe('application/vnd.github+json');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test('getIdentity tolerates a null name', async () => {
|
|
70
|
+
stubFetch(() => json({ login: 'ghost', name: null, avatar_url: 'a' }));
|
|
71
|
+
expect((await getIdentity('t')).name).toBeNull();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test('createRepo POSTs name/private/description/auto_init and shapes the result', async () => {
|
|
75
|
+
const calls = stubFetch(() =>
|
|
76
|
+
json({
|
|
77
|
+
full_name: 'octocat/acme',
|
|
78
|
+
clone_url: 'https://github.com/octocat/acme.git',
|
|
79
|
+
html_url: 'https://github.com/octocat/acme',
|
|
80
|
+
default_branch: 'main',
|
|
81
|
+
owner: { login: 'octocat' },
|
|
82
|
+
})
|
|
83
|
+
);
|
|
84
|
+
const repo = await createRepo('t', { name: 'acme', private: true, description: 'd' });
|
|
85
|
+
expect(repo.owner).toBe('octocat');
|
|
86
|
+
expect(repo.clone_url).toBe('https://github.com/octocat/acme.git');
|
|
87
|
+
expect(calls[0].url).toBe('https://api.github.com/user/repos');
|
|
88
|
+
expect(calls[0].init?.method).toBe('POST');
|
|
89
|
+
const body = JSON.parse(calls[0].init?.body as string);
|
|
90
|
+
expect(body).toEqual({ name: 'acme', private: true, description: 'd', auto_init: false });
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
test('createRepo maps 422 to a "name already taken" message', async () => {
|
|
94
|
+
stubFetch(() => json({ message: 'name already exists on this account' }, 422));
|
|
95
|
+
const err = await createRepo('t', { name: 'acme', private: true }).catch((e) => e);
|
|
96
|
+
expect(err).toBeInstanceOf(GitHubApiError);
|
|
97
|
+
expect((err as GitHubApiError).status).toBe(422);
|
|
98
|
+
expect((err as GitHubApiError).message).toMatch(/already have a project with that name/i);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
test('inviteCollaborator PUTs permission=push, 201 = invited', async () => {
|
|
102
|
+
const calls = stubFetch(() => json({ id: 1 }, 201));
|
|
103
|
+
const r = await inviteCollaborator('t', 'octocat', 'acme', 'anna');
|
|
104
|
+
expect(r.invited).toBe(true);
|
|
105
|
+
expect(calls[0].url).toBe('https://api.github.com/repos/octocat/acme/collaborators/anna');
|
|
106
|
+
expect(calls[0].init?.method).toBe('PUT');
|
|
107
|
+
expect(JSON.parse(calls[0].init?.body as string)).toEqual({ permission: 'push' });
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
test('inviteCollaborator 204 = already had access (not a new invite)', async () => {
|
|
111
|
+
stubFetch(() => new Response(null, { status: 204 }));
|
|
112
|
+
expect((await inviteCollaborator('t', 'o', 'r', 'anna')).invited).toBe(false);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test('inviteCollaborator maps 404 to "no GitHub user named X"', async () => {
|
|
116
|
+
stubFetch(() => json({ message: 'Not Found' }, 404));
|
|
117
|
+
const err = await inviteCollaborator('t', 'o', 'r', 'nobodyxyz').catch((e) => e);
|
|
118
|
+
expect((err as GitHubApiError).message).toMatch(/no github user named "nobodyxyz"/i);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('listUserRepos requests owner+collaborator, sorted, and maps rows', async () => {
|
|
122
|
+
const calls = stubFetch(() =>
|
|
123
|
+
json([
|
|
124
|
+
{
|
|
125
|
+
name: 'acme',
|
|
126
|
+
full_name: 'octocat/acme',
|
|
127
|
+
owner: { login: 'octocat' },
|
|
128
|
+
private: true,
|
|
129
|
+
html_url: 'h',
|
|
130
|
+
clone_url: 'c',
|
|
131
|
+
updated_at: '2026-06-18T00:00:00Z',
|
|
132
|
+
},
|
|
133
|
+
])
|
|
134
|
+
);
|
|
135
|
+
const repos = await listUserRepos('t');
|
|
136
|
+
expect(repos[0]).toEqual({
|
|
137
|
+
name: 'acme',
|
|
138
|
+
full_name: 'octocat/acme',
|
|
139
|
+
owner: 'octocat',
|
|
140
|
+
private: true,
|
|
141
|
+
html_url: 'h',
|
|
142
|
+
clone_url: 'c',
|
|
143
|
+
updated_at: '2026-06-18T00:00:00Z',
|
|
144
|
+
});
|
|
145
|
+
expect(calls[0].url).toContain('affiliation=owner,collaborator');
|
|
146
|
+
expect(calls[0].url).toContain('sort=updated');
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
test('401 maps to "sign-in expired", 403 rate-limit, 404 not-found', async () => {
|
|
150
|
+
stubFetch(() => json({ message: 'Bad credentials' }, 401));
|
|
151
|
+
expect(((await getIdentity('t').catch((e) => e)) as GitHubApiError).message).toMatch(
|
|
152
|
+
/sign-in expired/i
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
stubFetch(() => json({ message: 'API rate limit exceeded' }, 403));
|
|
156
|
+
expect(((await getIdentity('t').catch((e) => e)) as GitHubApiError).message).toMatch(
|
|
157
|
+
/rate-limit/i
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
stubFetch(() => json({ message: 'Not Found' }, 404));
|
|
161
|
+
expect(((await getIdentity('t').catch((e) => e)) as GitHubApiError).message).toMatch(
|
|
162
|
+
/couldn't find/i
|
|
163
|
+
);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
test('network failure maps to a connection message (status 0)', async () => {
|
|
167
|
+
globalThis.fetch = (async () => {
|
|
168
|
+
throw new Error('network down');
|
|
169
|
+
}) as typeof fetch;
|
|
170
|
+
const err = (await getIdentity('t').catch((e) => e)) as GitHubApiError;
|
|
171
|
+
expect(err.status).toBe(0);
|
|
172
|
+
expect(err.message).toMatch(/could not reach github/i);
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// ── (2) setRemote against a real iso-git repo ──────────────────────────────────
|
|
177
|
+
describe('setRemote (iso-git, no network)', () => {
|
|
178
|
+
let dir: string;
|
|
179
|
+
afterEach(() => {
|
|
180
|
+
if (dir) rmSync(dir, { recursive: true, force: true });
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
test('adds origin, and replaces it idempotently on re-run', async () => {
|
|
184
|
+
dir = mkdtempSync(join(tmpdir(), 'maude-gh-remote-'));
|
|
185
|
+
await git.init({ fs, dir, defaultBranch: 'main' });
|
|
186
|
+
|
|
187
|
+
await setRemote(dir, 'https://github.com/octocat/acme.git');
|
|
188
|
+
let remotes = await git.listRemotes({ fs, dir });
|
|
189
|
+
expect(remotes).toEqual([{ remote: 'origin', url: 'https://github.com/octocat/acme.git' }]);
|
|
190
|
+
|
|
191
|
+
// Re-run with a different URL → still exactly one origin (replaced, not duplicated).
|
|
192
|
+
await setRemote(dir, 'https://github.com/octocat/acme-2.git');
|
|
193
|
+
remotes = await git.listRemotes({ fs, dir });
|
|
194
|
+
expect(remotes).toEqual([{ remote: 'origin', url: 'https://github.com/octocat/acme-2.git' }]);
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
// ── (3) loopback token bridge (token.ts) ───────────────────────────────────────
|
|
199
|
+
describe('token bridge fetch', () => {
|
|
200
|
+
const savedEndpoint = process.env.MAUDE_TOKEN_ENDPOINT;
|
|
201
|
+
const savedKey = process.env.MAUDE_TOKEN_KEY;
|
|
202
|
+
afterEach(() => {
|
|
203
|
+
if (savedEndpoint === undefined) delete process.env.MAUDE_TOKEN_ENDPOINT;
|
|
204
|
+
else process.env.MAUDE_TOKEN_ENDPOINT = savedEndpoint;
|
|
205
|
+
if (savedKey === undefined) delete process.env.MAUDE_TOKEN_KEY;
|
|
206
|
+
else process.env.MAUDE_TOKEN_KEY = savedKey;
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
test('returns null + reports unavailable when env is absent (non-Tauri mode)', async () => {
|
|
210
|
+
delete process.env.MAUDE_TOKEN_ENDPOINT;
|
|
211
|
+
delete process.env.MAUDE_TOKEN_KEY;
|
|
212
|
+
expect(tokenBridgeAvailable()).toBe(false);
|
|
213
|
+
expect(await getGithubToken()).toBeNull();
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
test('sends the key header and returns the token on 200', async () => {
|
|
217
|
+
process.env.MAUDE_TOKEN_ENDPOINT = 'http://127.0.0.1:9/_tauri/github-token';
|
|
218
|
+
process.env.MAUDE_TOKEN_KEY = 'k123';
|
|
219
|
+
const calls = stubFetch(() => new Response('gho_secret\n', { status: 200 }));
|
|
220
|
+
expect(tokenBridgeAvailable()).toBe(true);
|
|
221
|
+
expect(await getGithubToken()).toBe('gho_secret');
|
|
222
|
+
expect((calls[0].init?.headers as Record<string, string>)['X-Maude-Token-Key']).toBe('k123');
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
test('returns null on 404 (not signed in) and 403 (bad key)', async () => {
|
|
226
|
+
process.env.MAUDE_TOKEN_ENDPOINT = 'http://127.0.0.1:9/_tauri/github-token';
|
|
227
|
+
process.env.MAUDE_TOKEN_KEY = 'k';
|
|
228
|
+
stubFetch(() => new Response('', { status: 404 }));
|
|
229
|
+
expect(await getGithubToken()).toBeNull();
|
|
230
|
+
stubFetch(() => new Response('', { status: 403 }));
|
|
231
|
+
expect(await getGithubToken()).toBeNull();
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
// ── (3b) endpoint validators + handlers ───────────────────────────────────────
|
|
236
|
+
describe('endpoint validators', () => {
|
|
237
|
+
test('slugifyRepoName normalizes human names', () => {
|
|
238
|
+
expect(epTesting.slugifyRepoName('Acme Rebrand')).toBe('acme-rebrand');
|
|
239
|
+
expect(epTesting.slugifyRepoName(' Weird!! Name ## ')).toBe('weird-name');
|
|
240
|
+
expect(epTesting.slugifyRepoName('keep.dots_and-dashes')).toBe('keep.dots_and-dashes');
|
|
241
|
+
expect(epTesting.slugifyRepoName('')).toBeNull();
|
|
242
|
+
expect(epTesting.slugifyRepoName('---')).toBeNull();
|
|
243
|
+
expect(epTesting.slugifyRepoName(42)).toBeNull();
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
test('parseGitHubRemote handles https + ssh, rejects non-github', () => {
|
|
247
|
+
expect(epTesting.parseGitHubRemote('https://github.com/octocat/acme.git')).toEqual({
|
|
248
|
+
owner: 'octocat',
|
|
249
|
+
repo: 'acme',
|
|
250
|
+
});
|
|
251
|
+
expect(epTesting.parseGitHubRemote('https://github.com/octocat/acme')).toEqual({
|
|
252
|
+
owner: 'octocat',
|
|
253
|
+
repo: 'acme',
|
|
254
|
+
});
|
|
255
|
+
expect(epTesting.parseGitHubRemote('git@github.com:octocat/acme.git')).toEqual({
|
|
256
|
+
owner: 'octocat',
|
|
257
|
+
repo: 'acme',
|
|
258
|
+
});
|
|
259
|
+
expect(epTesting.parseGitHubRemote('https://gitlab.com/octocat/acme.git')).toBeNull();
|
|
260
|
+
expect(epTesting.parseGitHubRemote('not a url')).toBeNull();
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
test('parseGitHubRemote anchors the host — rejects SSRF/credential-leak URLs (audit D-1/F-2)', () => {
|
|
264
|
+
// The original unanchored regex matched `github.com` as a PATH segment, so a
|
|
265
|
+
// crafted link cloned from (and leaked the PAT to) an attacker host. All null now.
|
|
266
|
+
for (const evil of [
|
|
267
|
+
'https://evil.com/github.com/o/r.git',
|
|
268
|
+
'https://evil.com/github.com/o/r',
|
|
269
|
+
'https://github.com.evil.com/o/r.git',
|
|
270
|
+
'https://evil.com#github.com/o/r.git',
|
|
271
|
+
'https://evil.com/?x=github.com/o/r',
|
|
272
|
+
'http://github.com/o/r.git', // http downgrade rejected
|
|
273
|
+
'ssh://git@evil.com/github.com/o/r.git',
|
|
274
|
+
]) {
|
|
275
|
+
expect(epTesting.parseGitHubRemote(evil)).toBeNull();
|
|
276
|
+
}
|
|
277
|
+
// Canonical URL is rebuilt only from the validated owner/repo.
|
|
278
|
+
expect(epTesting.canonicalGitHubCloneUrl('octocat', 'acme')).toBe(
|
|
279
|
+
'https://github.com/octocat/acme.git'
|
|
280
|
+
);
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
test('USERNAME_RE rejects leading/trailing/double hyphens + overlong', () => {
|
|
284
|
+
expect(epTesting.USERNAME_RE.test('octocat')).toBe(true);
|
|
285
|
+
expect(epTesting.USERNAME_RE.test('a-b-c')).toBe(true);
|
|
286
|
+
expect(epTesting.USERNAME_RE.test('-bad')).toBe(false);
|
|
287
|
+
expect(epTesting.USERNAME_RE.test('bad-')).toBe(false);
|
|
288
|
+
expect(epTesting.USERNAME_RE.test('a--b')).toBe(false);
|
|
289
|
+
expect(epTesting.USERNAME_RE.test('a'.repeat(40))).toBe(false);
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
describe('endpoint handlers', () => {
|
|
294
|
+
let dir: string;
|
|
295
|
+
const savedEndpoint = process.env.MAUDE_TOKEN_ENDPOINT;
|
|
296
|
+
const savedKey = process.env.MAUDE_TOKEN_KEY;
|
|
297
|
+
const BRIDGE = 'http://127.0.0.1:9/_tauri/github-token';
|
|
298
|
+
function ctxFor(d: string): Context {
|
|
299
|
+
return { paths: { repoRoot: d } } as unknown as Context;
|
|
300
|
+
}
|
|
301
|
+
afterEach(() => {
|
|
302
|
+
if (dir) rmSync(dir, { recursive: true, force: true });
|
|
303
|
+
if (savedEndpoint === undefined) delete process.env.MAUDE_TOKEN_ENDPOINT;
|
|
304
|
+
else process.env.MAUDE_TOKEN_ENDPOINT = savedEndpoint;
|
|
305
|
+
if (savedKey === undefined) delete process.env.MAUDE_TOKEN_KEY;
|
|
306
|
+
else process.env.MAUDE_TOKEN_KEY = savedKey;
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
test('401 when not signed in (no token bridge)', async () => {
|
|
310
|
+
delete process.env.MAUDE_TOKEN_ENDPOINT;
|
|
311
|
+
delete process.env.MAUDE_TOKEN_KEY;
|
|
312
|
+
dir = mkdtempSync(join(tmpdir(), 'maude-gh-ep-'));
|
|
313
|
+
const ep = createGitHubEndpoints(ctxFor(dir));
|
|
314
|
+
expect((await ep.identity()).status).toBe(401);
|
|
315
|
+
expect((await ep.repos()).status).toBe(401);
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
test('createRepo: 400 on empty name (before any token use)', async () => {
|
|
319
|
+
dir = mkdtempSync(join(tmpdir(), 'maude-gh-ep-'));
|
|
320
|
+
const ep = createGitHubEndpoints(ctxFor(dir));
|
|
321
|
+
const r = await ep.createRepo({ name: ' ' });
|
|
322
|
+
expect(r.status).toBe(400);
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
test('createRepo: slugifies, creates, sets origin (token via bridge + mocked GH)', async () => {
|
|
326
|
+
dir = mkdtempSync(join(tmpdir(), 'maude-gh-ep-'));
|
|
327
|
+
await git.init({ fs, dir, defaultBranch: 'main' });
|
|
328
|
+
process.env.MAUDE_TOKEN_ENDPOINT = BRIDGE;
|
|
329
|
+
process.env.MAUDE_TOKEN_KEY = 'k';
|
|
330
|
+
stubFetch((url) => {
|
|
331
|
+
if (url.includes('/_tauri/github-token')) return new Response('gho_x', { status: 200 });
|
|
332
|
+
// POST /user/repos
|
|
333
|
+
return json({
|
|
334
|
+
full_name: 'octocat/acme-rebrand',
|
|
335
|
+
clone_url: 'https://github.com/octocat/acme-rebrand.git',
|
|
336
|
+
html_url: 'https://github.com/octocat/acme-rebrand',
|
|
337
|
+
default_branch: 'main',
|
|
338
|
+
owner: { login: 'octocat' },
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
const ep = createGitHubEndpoints(ctxFor(dir));
|
|
342
|
+
const res = await ep.createRepo({ name: 'Acme Rebrand', private: true });
|
|
343
|
+
expect(res.status).toBe(200);
|
|
344
|
+
expect((res.json as { repo: { full_name: string } }).repo.full_name).toBe(
|
|
345
|
+
'octocat/acme-rebrand'
|
|
346
|
+
);
|
|
347
|
+
// origin was set on the local repo
|
|
348
|
+
const remotes = await git.listRemotes({ fs, dir });
|
|
349
|
+
expect(remotes).toEqual([
|
|
350
|
+
{ remote: 'origin', url: 'https://github.com/octocat/acme-rebrand.git' },
|
|
351
|
+
]);
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
test('invite: 400 on bad username, 409 when project has no GitHub origin', async () => {
|
|
355
|
+
dir = mkdtempSync(join(tmpdir(), 'maude-gh-ep-'));
|
|
356
|
+
await git.init({ fs, dir, defaultBranch: 'main' });
|
|
357
|
+
process.env.MAUDE_TOKEN_ENDPOINT = BRIDGE;
|
|
358
|
+
process.env.MAUDE_TOKEN_KEY = 'k';
|
|
359
|
+
const ep = createGitHubEndpoints(ctxFor(dir));
|
|
360
|
+
expect((await ep.invite({ username: '-bad-' })).status).toBe(400);
|
|
361
|
+
// valid username but no origin remote → 409
|
|
362
|
+
expect((await ep.invite({ username: 'anna' })).status).toBe(409);
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
test('clone: 400 on non-github url, traversal name, or missing parentDir', async () => {
|
|
366
|
+
dir = mkdtempSync(join(tmpdir(), 'maude-gh-ep-'));
|
|
367
|
+
const ep = createGitHubEndpoints(ctxFor(dir));
|
|
368
|
+
expect(
|
|
369
|
+
(await ep.clone({ cloneUrl: 'https://gitlab.com/x/y.git', parentDir: dir, name: 'y' })).status
|
|
370
|
+
).toBe(400);
|
|
371
|
+
expect(
|
|
372
|
+
(await ep.clone({ cloneUrl: 'https://github.com/o/r.git', parentDir: dir, name: '../evil' }))
|
|
373
|
+
.status
|
|
374
|
+
).toBe(400);
|
|
375
|
+
expect(
|
|
376
|
+
(
|
|
377
|
+
await ep.clone({
|
|
378
|
+
cloneUrl: 'https://github.com/o/r.git',
|
|
379
|
+
parentDir: '/no/such/dir/xyz123',
|
|
380
|
+
name: 'r',
|
|
381
|
+
})
|
|
382
|
+
).status
|
|
383
|
+
).toBe(400);
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
test('clone: 409 when the target folder already exists', async () => {
|
|
387
|
+
dir = mkdtempSync(join(tmpdir(), 'maude-gh-ep-'));
|
|
388
|
+
mkdirSync(join(dir, 'taken'));
|
|
389
|
+
const ep = createGitHubEndpoints(ctxFor(dir));
|
|
390
|
+
expect(
|
|
391
|
+
(await ep.clone({ cloneUrl: 'https://github.com/o/r.git', parentDir: dir, name: 'taken' }))
|
|
392
|
+
.status
|
|
393
|
+
).toBe(409);
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
test('createProject: 400 on empty name or missing parentDir', async () => {
|
|
397
|
+
dir = mkdtempSync(join(tmpdir(), 'maude-gh-ep-'));
|
|
398
|
+
const ep = createGitHubEndpoints(ctxFor(dir));
|
|
399
|
+
expect((await ep.createProject({ name: ' ', parentDir: dir })).status).toBe(400);
|
|
400
|
+
expect((await ep.createProject({ name: 'Acme', parentDir: '/no/such/xyz' })).status).toBe(400);
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
test('initDesign: scaffolds a bootable .design into a fresh folder; idempotent', async () => {
|
|
404
|
+
dir = mkdtempSync(join(tmpdir(), 'maude-gh-ep-'));
|
|
405
|
+
const ep = createGitHubEndpoints(ctxFor(dir));
|
|
406
|
+
const r = await ep.initDesign({ dir });
|
|
407
|
+
expect(r.status).toBe(200);
|
|
408
|
+
expect(hasDesign(dir)).toBe(true);
|
|
409
|
+
// already a project → ok + alreadyDesign
|
|
410
|
+
const r2 = await ep.initDesign({ dir });
|
|
411
|
+
expect(r2.status).toBe(200);
|
|
412
|
+
expect((r2.json as { alreadyDesign?: boolean }).alreadyDesign).toBe(true);
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
test('initDesign: 400 on a non-existent dir', async () => {
|
|
416
|
+
const ep = createGitHubEndpoints(ctxFor(mkdtempSync(join(tmpdir(), 'maude-gh-ep-'))));
|
|
417
|
+
expect((await ep.initDesign({ dir: '/no/such/xyz123' })).status).toBe(400);
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
test('invite: 200 with origin set (mocked GH 201 = invited)', async () => {
|
|
421
|
+
dir = mkdtempSync(join(tmpdir(), 'maude-gh-ep-'));
|
|
422
|
+
await git.init({ fs, dir, defaultBranch: 'main' });
|
|
423
|
+
await git.addRemote({ fs, dir, remote: 'origin', url: 'https://github.com/octocat/acme.git' });
|
|
424
|
+
process.env.MAUDE_TOKEN_ENDPOINT = BRIDGE;
|
|
425
|
+
process.env.MAUDE_TOKEN_KEY = 'k';
|
|
426
|
+
stubFetch((url) => {
|
|
427
|
+
if (url.includes('/_tauri/github-token')) return new Response('gho_x', { status: 200 });
|
|
428
|
+
return json({ id: 1 }, 201); // collaborator invitation created
|
|
429
|
+
});
|
|
430
|
+
const res = await createGitHubEndpoints(ctxFor(dir)).invite({ username: 'anna' });
|
|
431
|
+
expect(res.status).toBe(200);
|
|
432
|
+
expect((res.json as { invited: boolean }).invited).toBe(true);
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
// ── (4) guarded real-account pass — set MAUDE_GH_TEST_TOKEN to run ──────────────
|
|
437
|
+
// A scratch GitHub PAT/token with `repo read:user`. Creates + deletes a throwaway
|
|
438
|
+
// repo, so the auth shape is exercised end-to-end. Skipped in CI / normal runs.
|
|
439
|
+
const REAL = process.env.MAUDE_GH_TEST_TOKEN;
|
|
440
|
+
describe('real GitHub account (guarded by MAUDE_GH_TEST_TOKEN)', () => {
|
|
441
|
+
test.skipIf(!REAL)('getIdentity + listUserRepos + create/delete a scratch repo', async () => {
|
|
442
|
+
const token = REAL as string;
|
|
443
|
+
const id = await getIdentity(token);
|
|
444
|
+
expect(typeof id.login).toBe('string');
|
|
445
|
+
const repos = await listUserRepos(token);
|
|
446
|
+
expect(Array.isArray(repos)).toBe(true);
|
|
447
|
+
|
|
448
|
+
const name = `maude-scratch-${Date.now()}`;
|
|
449
|
+
const created = await createRepo(token, {
|
|
450
|
+
name,
|
|
451
|
+
private: true,
|
|
452
|
+
description: 'maude test — safe to delete',
|
|
453
|
+
});
|
|
454
|
+
expect(created.full_name).toBe(`${id.login}/${name}`);
|
|
455
|
+
// cleanup — delete the scratch repo (needs delete_repo scope; ignore failure)
|
|
456
|
+
await fetch(`https://api.github.com/repos/${id.login}/${name}`, {
|
|
457
|
+
method: 'DELETE',
|
|
458
|
+
headers: {
|
|
459
|
+
Authorization: `Bearer ${token}`,
|
|
460
|
+
'User-Agent': 'maude-desktop',
|
|
461
|
+
Accept: 'application/vnd.github+json',
|
|
462
|
+
},
|
|
463
|
+
}).catch(() => {});
|
|
464
|
+
});
|
|
465
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Phase 29 (E4) Door C — hub-link credential write. Validates the lean in-app
|
|
2
|
+
// counterpart to `maude design link`: input validation + the global hubs.json write
|
|
3
|
+
// (token + per-machine trust, mode 0600). The http-layer gating (main-origin +
|
|
4
|
+
// loopback) is covered by canvas-origin-gate.test.ts.
|
|
5
|
+
|
|
6
|
+
import { afterEach, beforeEach, expect, test } from 'bun:test';
|
|
7
|
+
import { existsSync, mkdtempSync, readFileSync, rmSync, statSync } from 'node:fs';
|
|
8
|
+
import { platform, tmpdir } from 'node:os';
|
|
9
|
+
import { join } from 'node:path';
|
|
10
|
+
|
|
11
|
+
import { linkHub, saveHubCredential } from '../sync/hub-link.ts';
|
|
12
|
+
|
|
13
|
+
let dir: string;
|
|
14
|
+
let prevPath: string | undefined;
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
dir = mkdtempSync(join(tmpdir(), 'maude-hublink-'));
|
|
18
|
+
prevPath = process.env.HUBS_CONFIG_PATH;
|
|
19
|
+
process.env.HUBS_CONFIG_PATH = join(dir, 'hubs.json');
|
|
20
|
+
});
|
|
21
|
+
afterEach(() => {
|
|
22
|
+
if (prevPath === undefined) delete process.env.HUBS_CONFIG_PATH;
|
|
23
|
+
else process.env.HUBS_CONFIG_PATH = prevPath;
|
|
24
|
+
rmSync(dir, { recursive: true, force: true });
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('rejects a missing url', async () => {
|
|
28
|
+
const r = await linkHub({ token: 'tok' });
|
|
29
|
+
expect(r.status).toBe(400);
|
|
30
|
+
expect((r.json as { ok: boolean }).ok).toBe(false);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('rejects a missing token', async () => {
|
|
34
|
+
const r = await linkHub({ url: 'https://hub.example.dev' });
|
|
35
|
+
expect(r.status).toBe(400);
|
|
36
|
+
expect((r.json as { ok: boolean }).ok).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('rejects a non-http(s) scheme (no file:/ftp: hub)', async () => {
|
|
40
|
+
const r = await linkHub({ url: 'file:///etc/passwd', token: 'tok' });
|
|
41
|
+
expect(r.status).toBe(400);
|
|
42
|
+
expect(existsSync(process.env.HUBS_CONFIG_PATH as string)).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('rejects a malformed url', async () => {
|
|
46
|
+
const r = await linkHub({ url: 'not a url', token: 'tok' });
|
|
47
|
+
expect(r.status).toBe(400);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test('saveHubCredential writes the token + records per-machine trust, mode 0600', () => {
|
|
51
|
+
saveHubCredential('https://hub.example.dev', 'mau_secret');
|
|
52
|
+
const p = process.env.HUBS_CONFIG_PATH as string;
|
|
53
|
+
const cfg = JSON.parse(readFileSync(p, 'utf8'));
|
|
54
|
+
expect(cfg.hubs['https://hub.example.dev'].token).toBe('mau_secret');
|
|
55
|
+
expect(typeof cfg.hubs['https://hub.example.dev'].linkedAt).toBe('number');
|
|
56
|
+
expect(cfg.trusted).toContain('https://hub.example.dev');
|
|
57
|
+
if (platform() !== 'win32') {
|
|
58
|
+
expect(statSync(p).mode & 0o777).toBe(0o600);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('a second credential for the same hub replaces the token (per-machine key)', () => {
|
|
63
|
+
saveHubCredential('https://hub.example.dev', 'first');
|
|
64
|
+
saveHubCredential('https://hub.example.dev', 'second');
|
|
65
|
+
const cfg = JSON.parse(readFileSync(process.env.HUBS_CONFIG_PATH as string, 'utf8'));
|
|
66
|
+
expect(cfg.hubs['https://hub.example.dev'].token).toBe('second');
|
|
67
|
+
// Trust is not duplicated.
|
|
68
|
+
expect(cfg.trusted.filter((u: string) => u === 'https://hub.example.dev')).toHaveLength(1);
|
|
69
|
+
});
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
// Unit: pure helpers from participants-chrome.tsx.
|
|
2
2
|
|
|
3
3
|
import { describe, expect, test } from 'bun:test';
|
|
4
|
+
import { initialsFor, isOwnEditingEcho } from '../participants-chrome.tsx';
|
|
5
|
+
import type { ForeignAwareness } from '../use-collab.tsx';
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
const peer = (over: Partial<ForeignAwareness>): ForeignAwareness => ({
|
|
8
|
+
clientID: 1,
|
|
9
|
+
name: 'Anna',
|
|
10
|
+
color: 'oklch(0.7 0.16 145)',
|
|
11
|
+
cursor: null,
|
|
12
|
+
selection: null,
|
|
13
|
+
annotationSelection: [],
|
|
14
|
+
viewport: { x: 0, y: 0, zoom: 1 },
|
|
15
|
+
editing: null,
|
|
16
|
+
...over,
|
|
17
|
+
});
|
|
6
18
|
|
|
7
19
|
describe('initialsFor', () => {
|
|
8
20
|
test('two-word name → uppercase first letters', () => {
|
|
@@ -28,3 +40,26 @@ describe('initialsFor', () => {
|
|
|
28
40
|
expect(initialsFor(' Alice Smith ')).toBe('AS');
|
|
29
41
|
});
|
|
30
42
|
});
|
|
43
|
+
|
|
44
|
+
describe('isOwnEditingEcho (Phase 30 / DDR-120)', () => {
|
|
45
|
+
test('skips MY own server-side editing echo (my name, editing, no cursor/selection)', () => {
|
|
46
|
+
expect(isOwnEditingEcho(peer({ name: 'Anna', editing: { since: 1 } }), 'Anna')).toBe(true);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('keeps a remote peer editing (different name)', () => {
|
|
50
|
+
expect(isOwnEditingEcho(peer({ name: 'Bob', editing: { since: 1 } }), 'Anna')).toBe(false);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('keeps MY peer if it has a live cursor (a real second tab, not the echo)', () => {
|
|
54
|
+
expect(
|
|
55
|
+
isOwnEditingEcho(
|
|
56
|
+
peer({ name: 'Anna', editing: { since: 1 }, cursor: { x: 1, y: 2 } }),
|
|
57
|
+
'Anna'
|
|
58
|
+
)
|
|
59
|
+
).toBe(false);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('keeps a peer that is not editing', () => {
|
|
63
|
+
expect(isOwnEditingEcho(peer({ name: 'Anna', editing: null }), 'Anna')).toBe(false);
|
|
64
|
+
});
|
|
65
|
+
});
|