From 89db60766e2e794e1bb9bd9f97a0ced5863661d1 Mon Sep 17 00:00:00 2001 From: OrcaWin <293788423+OrcaWin@users.noreply.github.com> Date: Fri, 13 Nov 2026 00:19:18 -0800 Subject: [PATCH] test: remove route forwarding and internal mobile marker cases --- ...obile-markdown-preview-placeholder.test.ts | 20 -------------- .../native-chat-github-route-repo.test.ts | 27 ------------------- 2 files changed, 47 deletions(-) delete mode 100644 mobile/src/components/mobile-markdown-preview-placeholder.test.ts diff --git a/mobile/src/components/mobile-markdown-preview-placeholder.test.ts b/mobile/src/components/mobile-markdown-preview-placeholder.test.ts deleted file mode 100644 index 94b266df9ad..00000000000 --- a/mobile/src/components/mobile-markdown-preview-placeholder.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { normalizeMobileMarkdownPreviewHtml } from './mobile-markdown-preview-html' - -const marker = '\uE000ORCA_MD_CODE_' -const suffix = '\uE000' - -describe('mobile Markdown code placeholder collisions', () => { - it.each([0, 1, 2, 15, 128, 16384])('preserves a literal marker with %i underscores', (length) => { - const literal = `${marker}${'_'.repeat(length)}0${suffix}` - const input = `${literal} and \`Array\`\n\n\`\`\`html\n

literal

\n\`\`\`` - expect(normalizeMobileMarkdownPreviewHtml(input)).toBe(input) - }) - - it('handles adjacent markers and repeated maximum suffixes', () => { - const literal = `${marker}${marker}__0${suffix}${marker}__1${suffix}${marker}_2${suffix}` - expect(normalizeMobileMarkdownPreviewHtml(`

${literal} and \`

\`

`)).toBe( - `${literal} and \`
\`` - ) - }) -}) diff --git a/src/renderer/src/components/native-chat/links/previews/native-chat-github-route-repo.test.ts b/src/renderer/src/components/native-chat/links/previews/native-chat-github-route-repo.test.ts index b5c81a6fa66..53de19f60a0 100644 --- a/src/renderer/src/components/native-chat/links/previews/native-chat-github-route-repo.test.ts +++ b/src/renderer/src/components/native-chat/links/previews/native-chat-github-route-repo.test.ts @@ -101,33 +101,6 @@ describe('GitHub preview routing for a chat without a repo of its own', () => { expect(pickGitHubPreviewRouteRepo([{ repo: orca, originKey: null }], privatePr)).toBeNull() }) - it('looks a private PR up through a local repo on github.com, as a preview', async () => { - const orca = repo('orca') - mocks.repos = [repo('folder', { kind: 'folder' }), orca] - mocks.slugs.set('orca', 'stablyai/orca') - const item = { type: 'pr', number: 685, title: 'perf: cacheable projections', state: 'draft' } - mocks.lookup.mockResolvedValue(item) - - await expect(loadRoutedGitHubLinkPreview('local', privatePr)).resolves.toBe(item) - expect(mocks.lookup.mock.calls[0][0]).toMatchObject({ - repoPath: '/src/orca', - repoId: 'orca', - owner: 'stablyai', - repo: 'orca-private', - number: 685, - type: 'pr', - preview: true - }) - }) - - it('answers nothing, leaving the web card, when no repo on the chat host uses GitHub', async () => { - mocks.repos = [repo('ghes')] - mocks.slugs.set('ghes', 'git.corp.example/team/app') - const link = parseGitHubIssueOrPRLink('https://github.com/stablyai/orca-private/pull/686')! - await expect(loadRoutedGitHubLinkPreview('local', link)).resolves.toBeNull() - expect(mocks.lookup).not.toHaveBeenCalled() - }) - it('uses the remaining repo after the repo that answered is removed', async () => { const link = parseGitHubIssueOrPRLink('https://github.com/acme/private/pull/701')! const alice = repo('alice', { ghAccount: { host: 'github.com', user: 'alice' } })