Skip to content

Commit f5c62bd

Browse files
committed
test(app-shell): pin authored edge text on a branch edge, not an approval outcome
After the merge of #34932 an approval's approve/reject out-edges render the designer's localized outcome pill, so the label-translation pin asserts the authored text on a decision branch edge instead. Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz Co-authored-by: Claude <noreply@anthropic.com>
1 parent bf090e8 commit f5c62bd

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎ui/packages/app-shell/src/views/metadata-admin/previews/FlowCanvas.test.tsx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ describe('Flow designer — package label translations (flows.<flow>.label, appr
640640
const EDGES = [
641641
{ source: 'start', target: 'manager_review' },
642642
{ source: 'manager_review', target: 'big', label: 'approve' },
643-
{ source: 'big', target: 'each' },
643+
{ source: 'big', target: 'each', label: 'Yes, over 1M' },
644644
];
645645
const DRAFT = { name: 'opportunity_approval', label: 'Large Deal Approval', nodes: NODES, edges: EDGES };
646646

@@ -682,7 +682,7 @@ describe('Flow designer — package label translations (flows.<flow>.label, appr
682682
expect(seen?.stepLabel({ id: 'manager_review', type: 'approval' })).toBe('经理审核');
683683
});
684684

685-
it('draws the translated approval-step labels on the canvas, nested ones included; decision and edge labels stay authored', () => {
685+
it('draws the translated approval-step labels on the canvas, nested ones included; decision and branch-edge labels stay authored', () => {
686686
const { container } = render(
687687
<FlowLabelTranslationsProvider value={zh()}>
688688
<FlowCanvas nodes={NODES} edges={EDGES} editable={false} designMode={false} selectedId={null} onSelect={() => {}} />
@@ -692,7 +692,9 @@ describe('Flow designer — package label translations (flows.<flow>.label, appr
692692
expect(card('manager_review').textContent).toContain('经理审核');
693693
expect(card('manager_review').textContent).not.toContain('Manager review');
694694
expect(card('big').textContent).toContain('Over 1M?');
695-
expect(screen.getByText('approve')).toBeInTheDocument();
695+
// A decision branch's authored edge label has no package key, so it stays as written. (An approval's
696+
// `approve` / `reject` outcome pills are the designer's own vocabulary, not the package bundle's.)
697+
expect(screen.getByText('Yes, over 1M')).toBeInTheDocument();
696698
fireEvent.click(screen.getByRole('button', { name: 'Expand nested regions' }));
697699
expect(card('each').textContent).toContain('总监签批');
698700
expect(card('each').textContent).not.toContain('Director sign-off');

0 commit comments

Comments
 (0)