fix: use investment stage names instead of internal reference labels
This commit is contained in:
@@ -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
|
## 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.
|
Pedido expresso do proprietário: a informação usada como exemplo não deve estar disponível ao público no simulador fiscal.
|
||||||
|
|||||||
@@ -348,11 +348,10 @@ function Stage({ step, path }: { step: Step; path: Path }) {
|
|||||||
licensing ? 'font-semibold' : 'cursor-pointer underline'
|
licensing ? 'font-semibold' : 'cursor-pointer underline'
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Fonte e referência desta etapa
|
Enquadramento desta etapa
|
||||||
</ReferenceHeading>
|
</ReferenceHeading>
|
||||||
<p>
|
<p>
|
||||||
Referência interna {step.code}. Documento original,
|
Etapa: {step.title}.{' '}
|
||||||
parágrafo {step.source_paragraph}.{' '}
|
|
||||||
{step.detail.scope === 'internal_validation'
|
{step.detail.scope === 'internal_validation'
|
||||||
? 'Conferência interna; não equivale a decisão externa.'
|
? 'Conferência interna; não equivale a decisão externa.'
|
||||||
: step.detail.scope === 'external_document_recorded'
|
: step.detail.scope === 'external_document_recorded'
|
||||||
|
|||||||
@@ -24,8 +24,13 @@ function load(path, mocks = {}, exportName = 'default', extra = '') {
|
|||||||
(name) =>
|
(name) =>
|
||||||
mocks[name] ??
|
mocks[name] ??
|
||||||
(name === '@/components/investment-step-help'
|
(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,
|
||||||
module.exports,
|
module.exports,
|
||||||
);
|
);
|
||||||
@@ -60,7 +65,12 @@ function stateHooks() {
|
|||||||
const flat = (node) =>
|
const flat = (node) =>
|
||||||
!node || typeof node !== 'object'
|
!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', () => {
|
void test('free navigation keeps every field mounted and reports resource work in the current group', () => {
|
||||||
const state = stateHooks();
|
const state = stateHooks();
|
||||||
const Component = load(
|
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, /Valor do investimento/);
|
||||||
assert.match(html, /id="preparation-questions"/);
|
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) => ({
|
const useForm = (data) => ({
|
||||||
data,
|
data,
|
||||||
errors: {},
|
errors: {},
|
||||||
@@ -359,7 +369,7 @@ void test('investment stages expose readable next actions while internal codes a
|
|||||||
assert.match(html, /<details[^>]*id="S01"[^>]*open/);
|
assert.match(html, /<details[^>]*id="S01"[^>]*open/);
|
||||||
assert.match(html, /<summary[^>]*>Sistematizar a ideia/);
|
assert.match(html, /<summary[^>]*>Sistematizar a ideia/);
|
||||||
assert.doesNotMatch(html, /<summary[^>]*>S01/);
|
assert.doesNotMatch(html, /<summary[^>]*>S01/);
|
||||||
assert.match(html, /Fonte e referência desta etapa/);
|
assert.match(html, /Enquadramento desta etapa/);
|
||||||
});
|
});
|
||||||
|
|
||||||
function preparationFixture() {
|
function preparationFixture() {
|
||||||
@@ -508,9 +518,15 @@ function contextPreviewHarness(overrides = {}) {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
const pending = [];
|
const pending = [];
|
||||||
const Editor = load('../../resources/js/pages/investor-path/context.tsx', {
|
const Editor = load(
|
||||||
|
'../../resources/js/pages/investor-path/context.tsx',
|
||||||
|
{
|
||||||
react: hooks,
|
react: hooks,
|
||||||
'@inertiajs/react': { usePage: () => ({ props: { auth: { user: { id: 1 } } } }), Link: () => null, router: {} },
|
'@inertiajs/react': {
|
||||||
|
usePage: () => ({ props: { auth: { user: { id: 1 } } } }),
|
||||||
|
Link: () => null,
|
||||||
|
router: {},
|
||||||
|
},
|
||||||
'@/components/navigation-context': {
|
'@/components/navigation-context': {
|
||||||
useNavigationContext: () => ({ refresh() {} }),
|
useNavigationContext: () => ({ refresh() {} }),
|
||||||
},
|
},
|
||||||
@@ -533,15 +549,29 @@ function contextPreviewHarness(overrides = {}) {
|
|||||||
input: 'input',
|
input: 'input',
|
||||||
button: 'button',
|
button: 'button',
|
||||||
},
|
},
|
||||||
'@/components/investment-budget-range': { default: load('../../resources/js/components/investment-budget-range.tsx', { './currency-select': { default: function CurrencySelect() {} } }) },
|
'@/components/investment-budget-range': {
|
||||||
|
default: load(
|
||||||
|
'../../resources/js/components/investment-budget-range.tsx',
|
||||||
|
{
|
||||||
|
'./currency-select': {
|
||||||
|
default: function CurrencySelect() {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
'@/lib/preparation-intent': preparationIntent,
|
'@/lib/preparation-intent': preparationIntent,
|
||||||
'@/components/currency-select': { default: function CurrencySelect() {} },
|
'@/components/currency-select': {
|
||||||
|
default: function CurrencySelect() {},
|
||||||
|
},
|
||||||
'@/components/investment-complements': {
|
'@/components/investment-complements': {
|
||||||
default: () => null,
|
default: () => null,
|
||||||
SelectedComplements: () => null,
|
SelectedComplements: () => null,
|
||||||
complementInput: (value) => value,
|
complementInput: (value) => value,
|
||||||
},
|
},
|
||||||
}, 'ScopedContextEditor', '\nexports.ScopedContextEditor = ScopedContextEditor;');
|
},
|
||||||
|
'ScopedContextEditor',
|
||||||
|
'\nexports.ScopedContextEditor = ScopedContextEditor;',
|
||||||
|
);
|
||||||
const props = {
|
const props = {
|
||||||
initial: {
|
initial: {
|
||||||
case: { id: 'synthetic', version: 1, title: 'Synthetic' },
|
case: { id: 'synthetic', version: 1, title: 'Synthetic' },
|
||||||
@@ -604,12 +634,21 @@ async function withDraftTimers(callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function readyDraftHarness() {
|
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.render();
|
||||||
harness.effects
|
harness.effects
|
||||||
.find((effect) => effect.dependencies?.length === 4)
|
.find((effect) => effect.dependencies?.length === 4)
|
||||||
.callback();
|
.callback();
|
||||||
if (harness.pending[0]) harness.pending[0].resolve({ corridors: [], parks: [] });
|
if (harness.pending[0])
|
||||||
|
harness.pending[0].resolve({ corridors: [], parks: [] });
|
||||||
await settlePreview();
|
await settlePreview();
|
||||||
harness.render();
|
harness.render();
|
||||||
return harness;
|
return harness;
|
||||||
@@ -695,7 +734,14 @@ void test('large multi-opportunity draft is offered to the transport on exit wit
|
|||||||
};
|
};
|
||||||
let cleanup;
|
let cleanup;
|
||||||
try {
|
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();
|
const initial = harness.render();
|
||||||
cleanup = harness.effects
|
cleanup = harness.effects
|
||||||
.find(
|
.find(
|
||||||
@@ -749,7 +795,14 @@ void test('successful save followed by failed recovery offers read-only retry an
|
|||||||
};
|
};
|
||||||
let cleanup;
|
let cleanup;
|
||||||
try {
|
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();
|
const initial = harness.render();
|
||||||
cleanup = harness.effects
|
cleanup = harness.effects
|
||||||
.find(
|
.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(harness.pending.length, 2);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
flat(failed).find(
|
flat(failed).find((node) => node.props.label === 'Moeda do orçamento')
|
||||||
(node) => node.props.label === 'Moeda do orçamento',
|
.props.value,
|
||||||
).props.value,
|
|
||||||
'MZN',
|
'MZN',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -888,9 +940,8 @@ void test('context comparison locks declaration and replacement controls until i
|
|||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
flat(ready).find(
|
flat(ready).find((node) => node.props.label === 'Moeda do orçamento')
|
||||||
(node) => node.props.label === 'Moeda do orçamento',
|
.props.disabled,
|
||||||
).props.disabled,
|
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -922,9 +973,8 @@ void test('context comparison rejects a response for a draft changed while the r
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
flat(stale).find(
|
flat(stale).find((node) => node.props.label === 'Moeda do orçamento')
|
||||||
(node) => node.props.label === 'Moeda do orçamento',
|
.props.value,
|
||||||
).props.value,
|
|
||||||
'USD',
|
'USD',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -128,6 +128,12 @@ test('S08 has one current state, a visible primary save action and no nested dis
|
|||||||
const tree = h.render();
|
const tree = h.render();
|
||||||
const nodes = flatten(tree);
|
const nodes = flatten(tree);
|
||||||
assert.equal(tree.type, 'section');
|
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((n) => n.type === 'details').length, 0);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
nodes.filter(
|
nodes.filter(
|
||||||
|
|||||||
Reference in New Issue
Block a user