diff --git a/docs/investmoz/unification/traceability-and-manual.md b/docs/investmoz/unification/traceability-and-manual.md index 4175b7b2..b4188db5 100644 --- a/docs/investmoz/unification/traceability-and-manual.md +++ b/docs/investmoz/unification/traceability-and-manual.md @@ -1,3 +1,7 @@ +## Designação das etapas — 23/11/2026 + +Pedido do proprietário: usar o nome correcto em vez de «Referência interna S08». Confirmado em InvestorPathDefinition: S08 corresponde a «Licenciamento prévio». A apresentação reutiliza agora o título real de cada etapa, com «Enquadramento desta etapa», sem mostrar o código interno ou o número do parágrafo documental no texto explicativo. Identificadores, âncoras, ligações, fonte e histórico permanecem nos dados; permissões e preparação privada inalteradas. Cinco verificações dirigidas de apresentação/etapas aprovadas. Alteração em QA, sem instalação/publicação. + ## E41 — Retirada do cenário demonstrativo do simulador — 23/11/2026 Pedido expresso do proprietário: a informação usada como exemplo não deve estar disponível ao público no simulador fiscal. diff --git a/resources/js/pages/investor-path/show.tsx b/resources/js/pages/investor-path/show.tsx index f6d416a7..643038b0 100644 --- a/resources/js/pages/investor-path/show.tsx +++ b/resources/js/pages/investor-path/show.tsx @@ -348,11 +348,10 @@ function Stage({ step, path }: { step: Step; path: Path }) { licensing ? 'font-semibold' : 'cursor-pointer underline' } > - Fonte e referência desta etapa + Enquadramento desta etapa
- Referência interna {step.code}. Documento original,
- parágrafo {step.source_paragraph}.{' '}
+ Etapa: {step.title}.{' '}
{step.detail.scope === 'internal_validation'
? 'Conferência interna; não equivale a decisão externa.'
: step.detail.scope === 'external_document_recorded'
diff --git a/tests/frontend/investor-usability-components.test.mjs b/tests/frontend/investor-usability-components.test.mjs
index 78f7ff34..28485d47 100644
--- a/tests/frontend/investor-usability-components.test.mjs
+++ b/tests/frontend/investor-usability-components.test.mjs
@@ -24,8 +24,13 @@ function load(path, mocks = {}, exportName = 'default', extra = '') {
(name) =>
mocks[name] ??
(name === '@/components/investment-step-help'
- ? { HelpAtStep: () => null, InvestmentHelpGuide: ({ children }) => children }
- : name.startsWith('@/') ? { default: () => null } : require(name)),
+ ? {
+ HelpAtStep: () => null,
+ InvestmentHelpGuide: ({ children }) => children,
+ }
+ : name.startsWith('@/')
+ ? { default: () => null }
+ : require(name)),
module,
module.exports,
);
@@ -60,7 +65,12 @@ function stateHooks() {
const flat = (node) =>
!node || typeof node !== 'object'
? []
- : [node, ...(node.type?.name === 'InvestmentBudgetRange' ? flat(node.type(node.props)) : React.Children.toArray(node.props?.children).flatMap(flat))];
+ : [
+ node,
+ ...(node.type?.name === 'InvestmentBudgetRange'
+ ? flat(node.type(node.props))
+ : React.Children.toArray(node.props?.children).flatMap(flat)),
+ ];
void test('free navigation keeps every field mounted and reports resource work in the current group', () => {
const state = stateHooks();
const Component = load(
@@ -307,7 +317,7 @@ void test('document entry leads to existing fillable preparation and keeps sourc
assert.match(html, /Valor do investimento/);
assert.match(html, /id="preparation-questions"/);
});
-void test('investment stages expose readable next actions while internal codes and sources remain consultable', () => {
+void test('investment stages expose readable next actions and context without technical source labels', () => {
const useForm = (data) => ({
data,
errors: {},
@@ -359,7 +369,7 @@ void test('investment stages expose readable next actions while internal codes a
assert.match(html, /]*>Sistematizar a ideia/);
assert.doesNotMatch(html, /
]*>S01/);
- assert.match(html, /Fonte e referência desta etapa/);
+ assert.match(html, /Enquadramento desta etapa/);
});
function preparationFixture() {
@@ -508,40 +518,60 @@ function contextPreviewHarness(overrides = {}) {
},
};
const pending = [];
- const Editor = load('../../resources/js/pages/investor-path/context.tsx', {
- react: hooks,
- '@inertiajs/react': { usePage: () => ({ props: { auth: { user: { id: 1 } } } }), Link: () => null, router: {} },
- '@/components/navigation-context': {
- useNavigationContext: () => ({ refresh() {} }),
- },
- '@/lib/operation-key': {
- createOperationKey: () => 'synthetic-operation',
- },
- '@/lib/investor-context': {
- contextFieldNames: {
- project_title: 'Título',
- project_summary: 'Resumo',
+ const Editor = load(
+ '../../resources/js/pages/investor-path/context.tsx',
+ {
+ react: hooks,
+ '@inertiajs/react': {
+ usePage: () => ({ props: { auth: { user: { id: 1 } } } }),
+ Link: () => null,
+ router: {},
},
- contextApi: (url, body) =>
- new Promise((resolve, reject) =>
- pending.push({ url, body, resolve, reject }),
+ '@/components/navigation-context': {
+ useNavigationContext: () => ({ refresh() {} }),
+ },
+ '@/lib/operation-key': {
+ createOperationKey: () => 'synthetic-operation',
+ },
+ '@/lib/investor-context': {
+ contextFieldNames: {
+ project_title: 'Título',
+ project_summary: 'Resumo',
+ },
+ contextApi: (url, body) =>
+ new Promise((resolve, reject) =>
+ pending.push({ url, body, resolve, reject }),
+ ),
+ },
+ '@/pages/investment/shared': {
+ Frame: () => null,
+ card: 'card',
+ input: 'input',
+ button: 'button',
+ },
+ '@/components/investment-budget-range': {
+ default: load(
+ '../../resources/js/components/investment-budget-range.tsx',
+ {
+ './currency-select': {
+ default: function CurrencySelect() {},
+ },
+ },
),
+ },
+ '@/lib/preparation-intent': preparationIntent,
+ '@/components/currency-select': {
+ default: function CurrencySelect() {},
+ },
+ '@/components/investment-complements': {
+ default: () => null,
+ SelectedComplements: () => null,
+ complementInput: (value) => value,
+ },
},
- '@/pages/investment/shared': {
- Frame: () => null,
- card: 'card',
- input: 'input',
- button: 'button',
- },
- '@/components/investment-budget-range': { default: load('../../resources/js/components/investment-budget-range.tsx', { './currency-select': { default: function CurrencySelect() {} } }) },
- '@/lib/preparation-intent': preparationIntent,
- '@/components/currency-select': { default: function CurrencySelect() {} },
- '@/components/investment-complements': {
- default: () => null,
- SelectedComplements: () => null,
- complementInput: (value) => value,
- },
- }, 'ScopedContextEditor', '\nexports.ScopedContextEditor = ScopedContextEditor;');
+ 'ScopedContextEditor',
+ '\nexports.ScopedContextEditor = ScopedContextEditor;',
+ );
const props = {
initial: {
case: { id: 'synthetic', version: 1, title: 'Synthetic' },
@@ -604,12 +634,21 @@ async function withDraftTimers(callback) {
}
}
async function readyDraftHarness() {
- const harness = contextPreviewHarness({ territorySelection: [{ id: 'synthetic-province', name: 'Synthetic province', location_type: 'province' }] });
+ const harness = contextPreviewHarness({
+ territorySelection: [
+ {
+ id: 'synthetic-province',
+ name: 'Synthetic province',
+ location_type: 'province',
+ },
+ ],
+ });
harness.render();
harness.effects
.find((effect) => effect.dependencies?.length === 4)
.callback();
- if (harness.pending[0]) harness.pending[0].resolve({ corridors: [], parks: [] });
+ if (harness.pending[0])
+ harness.pending[0].resolve({ corridors: [], parks: [] });
await settlePreview();
harness.render();
return harness;
@@ -695,7 +734,14 @@ void test('large multi-opportunity draft is offered to the transport on exit wit
};
let cleanup;
try {
- const harness = contextPreviewHarness({ requestedChoices: [{ opportunity: { key: 'opportunity:1', title: 'Synthetic' }, territory: null }] });
+ const harness = contextPreviewHarness({
+ requestedChoices: [
+ {
+ opportunity: { key: 'opportunity:1', title: 'Synthetic' },
+ territory: null,
+ },
+ ],
+ });
const initial = harness.render();
cleanup = harness.effects
.find(
@@ -749,7 +795,14 @@ void test('successful save followed by failed recovery offers read-only retry an
};
let cleanup;
try {
- const harness = contextPreviewHarness({ requestedChoices: [{ opportunity: { key: 'opportunity:1', title: 'Synthetic' }, territory: null }] });
+ const harness = contextPreviewHarness({
+ requestedChoices: [
+ {
+ opportunity: { key: 'opportunity:1', title: 'Synthetic' },
+ territory: null,
+ },
+ ],
+ });
const initial = harness.render();
cleanup = harness.effects
.find(
@@ -850,9 +903,8 @@ void test('failed save retains edits and permits retry without claiming that the
);
assert.equal(harness.pending.length, 2);
assert.equal(
- flat(failed).find(
- (node) => node.props.label === 'Moeda do orçamento',
- ).props.value,
+ flat(failed).find((node) => node.props.label === 'Moeda do orçamento')
+ .props.value,
'MZN',
);
});
@@ -888,9 +940,8 @@ void test('context comparison locks declaration and replacement controls until i
false,
);
assert.equal(
- flat(ready).find(
- (node) => node.props.label === 'Moeda do orçamento',
- ).props.disabled,
+ flat(ready).find((node) => node.props.label === 'Moeda do orçamento')
+ .props.disabled,
false,
);
});
@@ -922,9 +973,8 @@ void test('context comparison rejects a response for a draft changed while the r
),
);
assert.equal(
- flat(stale).find(
- (node) => node.props.label === 'Moeda do orçamento',
- ).props.value,
+ flat(stale).find((node) => node.props.label === 'Moeda do orçamento')
+ .props.value,
'USD',
);
});
diff --git a/tests/frontend/licensing-stage.test.mjs b/tests/frontend/licensing-stage.test.mjs
index 960d1257..38ac101a 100644
--- a/tests/frontend/licensing-stage.test.mjs
+++ b/tests/frontend/licensing-stage.test.mjs
@@ -128,6 +128,12 @@ test('S08 has one current state, a visible primary save action and no nested dis
const tree = h.render();
const nodes = flatten(tree);
assert.equal(tree.type, 'section');
+ assert.match(text(tree), /Etapa: Licenciamento prévio/);
+ assert.doesNotMatch(
+ text(tree),
+ /Referência interna S08|Documento original,|parágrafo 8/,
+ );
+
assert.equal(nodes.filter((n) => n.type === 'details').length, 0);
assert.equal(
nodes.filter(