mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
test: remove low-value theme and copy suites (#36140)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
@@ -7764,7 +7764,6 @@
|
||||
"src/renderer/src/components/feature-wall/agents-orchestration/UsageAccountsCard.test.tsx": 644,
|
||||
"src/renderer/src/components/feature-wall/browser-animated-visual-sequence.test.ts": 42,
|
||||
"src/renderer/src/components/feature-wall/feature-wall-animation-visibility.test.tsx": 592,
|
||||
"src/renderer/src/components/feature-wall/feature-wall-setup-checklist-localized-copy.test.ts": 578,
|
||||
"src/renderer/src/components/feature-wall/feature-wall-setup-progress.test.ts": 62,
|
||||
"src/renderer/src/components/feature-wall/use-feature-wall-completion.test.ts": 47,
|
||||
"src/renderer/src/components/feature-wall/use-feature-wall-tour-telemetry.test.ts": 31,
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { hostedReviewCopy } from './hosted-review-copy'
|
||||
|
||||
describe('hostedReviewCopy', () => {
|
||||
it('uses Merge Request labels for GitLab', () => {
|
||||
expect(hostedReviewCopy('gitlab')).toEqual({
|
||||
shortLabel: 'MR',
|
||||
reviewLabel: 'merge request',
|
||||
titleLabel: 'Merge Request'
|
||||
})
|
||||
})
|
||||
|
||||
it('uses Pull Request labels for GitHub and other providers and undefined', () => {
|
||||
const pr = { shortLabel: 'PR', reviewLabel: 'pull request', titleLabel: 'Pull Request' }
|
||||
expect(hostedReviewCopy('github')).toEqual(pr)
|
||||
expect(hostedReviewCopy('bitbucket')).toEqual(pr)
|
||||
expect(hostedReviewCopy(undefined)).toEqual(pr)
|
||||
})
|
||||
})
|
||||
@@ -1,69 +0,0 @@
|
||||
import { readFileSync, readdirSync } from 'node:fs'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { join, relative } from 'node:path'
|
||||
import ts from 'typescript-api'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
const mobileRoot = fileURLToPath(new URL('../..', import.meta.url))
|
||||
const scannedDirectories = ['src', 'app', 'web-entry']
|
||||
const paletteObjects = new Set(['colors'])
|
||||
// The terminal background is the same in both palettes.
|
||||
const schemeIndependentKeys = new Set(['terminalBg'])
|
||||
|
||||
function sourceFiles(directory: string): string[] {
|
||||
return readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
|
||||
const path = join(directory, entry.name)
|
||||
if (entry.isDirectory()) {
|
||||
return entry.name === 'node_modules' ? [] : sourceFiles(path)
|
||||
}
|
||||
return /\.tsx?$/.test(entry.name) &&
|
||||
!/\.test\.tsx?$/.test(entry.name) &&
|
||||
!entry.name.endsWith('.generated.ts')
|
||||
? [path]
|
||||
: []
|
||||
})
|
||||
}
|
||||
|
||||
// Palette reads that run while a module loads, outside any function, keep the scheme the app started in.
|
||||
function moduleScopePaletteReads(path: string): string[] {
|
||||
const source = readFileSync(path, 'utf8')
|
||||
const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true)
|
||||
const reads: string[] = []
|
||||
const visit = (node: ts.Node): void => {
|
||||
if (ts.isFunctionLike(node) || ts.isClassLike(node)) {
|
||||
return
|
||||
}
|
||||
if (
|
||||
ts.isPropertyAccessExpression(node) &&
|
||||
ts.isIdentifier(node.expression) &&
|
||||
paletteObjects.has(node.expression.text) &&
|
||||
!schemeIndependentKeys.has(node.name.text)
|
||||
) {
|
||||
const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart())
|
||||
reads.push(`${relative(mobileRoot, path)}:${line + 1} ${node.getText()}`)
|
||||
}
|
||||
// Spreading a themed stylesheet copies the scheme current at load.
|
||||
if (
|
||||
(ts.isSpreadAssignment(node) || ts.isSpreadElement(node)) &&
|
||||
((ts.isIdentifier(node.expression) && /[sS]tyles$/.test(node.expression.text)) ||
|
||||
(ts.isCallExpression(node.expression) &&
|
||||
ts.isIdentifier(node.expression.expression) &&
|
||||
node.expression.expression.text.startsWith('themedStyle')))
|
||||
) {
|
||||
const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart())
|
||||
reads.push(`${relative(mobileRoot, path)}:${line + 1} ${node.getText()}`)
|
||||
}
|
||||
ts.forEachChild(node, visit)
|
||||
}
|
||||
ts.forEachChild(sourceFile, visit)
|
||||
return reads
|
||||
}
|
||||
|
||||
describe('mobile theme module scope', () => {
|
||||
it('reads palette colors and themed styles only while rendering or inside themedStyles', () => {
|
||||
const reads = scannedDirectories
|
||||
.flatMap((directory) => sourceFiles(join(mobileRoot, directory)))
|
||||
.flatMap(moduleScopePaletteReads)
|
||||
expect(reads).toEqual([])
|
||||
})
|
||||
})
|
||||
@@ -1,10 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileConnectionPathLabel } from './mobile-connection-path-label'
|
||||
|
||||
describe('mobile connection path label', () => {
|
||||
it('distinguishes LAN, Tailscale, and the relay without exposing transport errors', () => {
|
||||
expect(mobileConnectionPathLabel('lan')).toBe('Direct · LAN')
|
||||
expect(mobileConnectionPathLabel('tailscale')).toBe('Direct · Tailscale')
|
||||
expect(mobileConnectionPathLabel('relay')).toBe('Orca Relay')
|
||||
})
|
||||
})
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { FEATURE_WALL_SETUP_STEPS } from '../../../../shared/feature-wall-setup-steps'
|
||||
import { getLocalizedFeatureWallSetupChecklistCopy } from './feature-wall-setup-checklist-localized-copy'
|
||||
|
||||
import { i18n } from '../../i18n/i18n'
|
||||
|
||||
describe('feature-wall-setup-checklist-localized-copy', () => {
|
||||
it.each(['ja', 'ko'])(
|
||||
'resolves every checklist step through the %s runtime catalog',
|
||||
async (locale) => {
|
||||
try {
|
||||
await i18n.changeLanguage(locale)
|
||||
for (const step of FEATURE_WALL_SETUP_STEPS) {
|
||||
const localized = getLocalizedFeatureWallSetupChecklistCopy(step)
|
||||
expect(localized.name, step.id).not.toBe(step.name)
|
||||
expect(localized.description, step.id).not.toBe(step.description)
|
||||
}
|
||||
} finally {
|
||||
await i18n.changeLanguage('en')
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user