|
22 | 22 | */ |
23 | 23 |
|
24 | 24 | import { describe, it, expect } from 'vitest'; |
| 25 | +import { templateSlotSource } from '@objectstack/spec/automation'; |
25 | 26 | import { SysApprovalRequest } from './sys-approval-request.object.js'; |
26 | 27 |
|
27 | 28 | const actions = (SysApprovalRequest as any).actions as any[]; |
@@ -134,18 +135,22 @@ describe('sys_approval_request declared actions', () => { |
134 | 135 | it('the confirm question rides `description`, not `confirmText`, so one decision opens one dialog (#7278)', () => { |
135 | 136 | const reject = byName('approval_reject'); |
136 | 137 | expect(reject.confirmText).toBeUndefined(); |
137 | | - expect(reject.description).toBe( |
| 138 | + // `description` is a `template` slot (#27948): the parsed value is the |
| 139 | + // envelope, so the sentence is read through the slot's one reader. |
| 140 | + const rejectText = templateSlotSource(reject.description); |
| 141 | + expect(rejectText).toBe( |
138 | 142 | 'Reject this request? A rejection is final for every approver.', |
139 | 143 | ); |
140 | 144 | // the finality warning is the half that must survive the move |
141 | | - expect(reject.description).toContain('final for every approver'); |
| 145 | + expect(rejectText).toContain('final for every approver'); |
142 | 146 |
|
143 | 147 | const recall = byName('approval_recall'); |
144 | 148 | expect(recall.confirmText).toBeUndefined(); |
145 | | - expect(recall.description).toBe( |
| 149 | + const recallText = templateSlotSource(recall.description); |
| 150 | + expect(recallText).toBe( |
146 | 151 | 'Recall this request? Approvers can no longer act on it and the record is unlocked.', |
147 | 152 | ); |
148 | | - expect(recall.description).toContain('can no longer act on it'); |
| 153 | + expect(recallText).toContain('can no longer act on it'); |
149 | 154 | }); |
150 | 155 |
|
151 | 156 | it('no declared action pairs `confirmText` with `params` (#7278 ruling, object-wide)', () => { |
|
0 commit comments