mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
716 files rewritten, 30 renamed, same family mapping as the frontend pass.
Held back, and each for a reason rather than by oversight:
db_table values insights_hogfunction, insights_hogflow,
insights_hogfunctiontemplate, hogflow_templates.
Renaming a table is ALTER TABLE, so it ships as a
migration with the raw SQL in nodejs that names it.
hog_invocation_results a Datastore table with Kafka engine tables on it
products/review_hog the module path is the Django app path; moving it
moves app_label and every migration is recorded under
(app_label, name). That is the same history break as
renaming a migration file, one level up.
*/migrations/* five files, untouched
whogho an integration vendor
Checked: 395 of 397 changed Python files compile. The two that do not —
insightsql/database/database.py and temporal/schedule.py — fail identically at
origin/main under the same interpreter, because they use `type X = ...` and
`except*`, which need the 3.13 this repo pins and not the 3.9 doing the check.
Running the check against the original is what told those apart from a real
break.
Co-authored-by: Hanzo Dev <[email protected]>
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
import { render, waitFor } from '@testing-library/react'
|
|
|
|
import api from 'lib/api'
|
|
|
|
import { initKeaTests } from '~/test/init'
|
|
|
|
import { WorkflowActivityLink } from './WorkflowActivityLink'
|
|
|
|
describe('WorkflowActivityLink', () => {
|
|
let getInsightsFlow: jest.SpyInstance
|
|
|
|
beforeEach(() => {
|
|
initKeaTests()
|
|
getInsightsFlow = jest.spyOn(api.flows, 'getInsightsFlow')
|
|
})
|
|
|
|
afterEach(() => {
|
|
getInsightsFlow.mockRestore()
|
|
})
|
|
|
|
it('renders the current workflow name resolved by id, not from the log', async () => {
|
|
getInsightsFlow.mockResolvedValue({ id: 'flow-1', name: 'Escalation workflow' } as any)
|
|
|
|
const { container } = render(<WorkflowActivityLink id="flow-1" />)
|
|
|
|
await waitFor(() => expect(container.textContent).toContain('Escalation workflow'))
|
|
expect(getInsightsFlow).toHaveBeenCalledWith('flow-1')
|
|
expect(container.querySelector('a')?.getAttribute('href')).toContain('flow-1')
|
|
})
|
|
|
|
it('falls back to a generic label when the workflow is not found', async () => {
|
|
getInsightsFlow.mockRejectedValue(new Error('Not found'))
|
|
|
|
const { container } = render(<WorkflowActivityLink id="missing" />)
|
|
|
|
await waitFor(() => expect(container.textContent).toContain('A workflow'))
|
|
expect(container.querySelector('a')?.getAttribute('href')).toContain('missing')
|
|
})
|
|
})
|