mirror of
https://github.com/stablyai/orca.git
synced 2026-11-17 11:24:37 +00:00
test: remove low-value renderer main shared and script suites (#42548)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { githubBodyImageUrls } from './body-image-urls'
|
||||
|
||||
const original = 'https://github.com/user-attachments/assets/ce11040a-fb66-4289-927f-547b16dfc488'
|
||||
const signed =
|
||||
'https://private-user-images.githubusercontent.com/1/2-ce11040a-fb66-4289-927f-547b16dfc488.png?jwt=TEST&download=1'
|
||||
|
||||
describe('GitHub body image sources', () => {
|
||||
it('matches rendered images to canonical assets without changing editable Markdown', () => {
|
||||
const body = `\n<img src="https://github.enterprise/team/repo/assets/42/ab11040a-fb66-4289-927f-547b16dfc488">\n\n\`https://github.com/user-attachments/assets/dd11040a-fb66-4289-927f-547b16dfc488\``
|
||||
const html = `<img src="https://private-user-images.githubusercontent.com/1/2-ce11040a-fb66-4289-927f-547b16dfc488.png?jwt=TEST&download=1"><img src="https://github.enterprise/storage/ab11040a-fb66-4289-927f-547b16dfc488.png?jwt=TEST"><code>https://private-user-images.githubusercontent.com/1/dd11040a-fb66-4289-927f-547b16dfc488.png</code>`
|
||||
expect(githubBodyImageUrls(body, html)).toEqual({
|
||||
'https://github.com/user-attachments/assets/ce11040a-fb66-4289-927f-547b16dfc488': signed,
|
||||
'https://github.enterprise/team/repo/assets/42/ab11040a-fb66-4289-927f-547b16dfc488':
|
||||
'https://github.enterprise/storage/ab11040a-fb66-4289-927f-547b16dfc488.png?jwt=TEST'
|
||||
})
|
||||
expect(githubBodyImageUrls(body, undefined)).toBeUndefined()
|
||||
expect(githubBodyImageUrls(``, `<img src="${original}">`)).toBeUndefined()
|
||||
expect(
|
||||
githubBodyImageUrls(
|
||||
body,
|
||||
'<img src="https://unrelated.example/ce11040a-fb66-4289-927f-547b16dfc488.png">'
|
||||
)
|
||||
).toBeUndefined()
|
||||
})
|
||||
})
|
||||
@@ -1,27 +0,0 @@
|
||||
import { expect, it, vi } from 'vitest'
|
||||
import { api, capture } from '../../work-items/work-item-search-test-harness'
|
||||
import { listWorkItems } from './list-work-items'
|
||||
import './count-work-items'
|
||||
import metadata from '../../__fixtures__/work-item-search-metadata.json'
|
||||
|
||||
it('hydrates oversized associations with the preferred page credential', async () => {
|
||||
vi.stubEnv('GH_TOKEN', 'fixture-original-credential')
|
||||
const row = structuredClone(metadata[0].graphql)
|
||||
api.specialNodes = [{ ...row, labels: { ...row.labels, pageInfo: { hasNextPage: true } } }]
|
||||
capture.mockImplementation(async (binary, args, options) => {
|
||||
if (args.includes('graphql')) {
|
||||
vi.stubEnv('GH_TOKEN', 'fixture-later-credential')
|
||||
}
|
||||
return api.capture(binary, args, options)
|
||||
})
|
||||
const result = await listWorkItems('fixture/repo', 24, 'is:issue')
|
||||
expect(result.items[0].labels).toHaveLength(125)
|
||||
const queries = api.calls.filter(
|
||||
(call) =>
|
||||
call.args.includes('graphql') || call.args.some((arg) => /^repos\/.+\/issues\/\d+$/.test(arg))
|
||||
)
|
||||
expect(queries.map((call) => call.fixtureCredential)).toEqual([
|
||||
'fixture-original-credential',
|
||||
'fixture-original-credential'
|
||||
])
|
||||
})
|
||||
Reference in New Issue
Block a user