|
|
@@ -2,7 +2,8 @@ const assert = require('assert');
|
|
|
const { mergeRequiredMenus, normalizeMenus } = require('../utils/homeMenu');
|
|
|
const { isWhitelisted, lookupRoute } = require('../utils/homeRoute');
|
|
|
|
|
|
-const MRC_ENTRY_ROUTE = '/packageMRC/pages/entry/index';
|
|
|
+const MRC_ENTRY_ROUTE = '/packageMRC/pages/apply-entry/index';
|
|
|
+const MRC_DEVELOPER_TOOL_ROUTE = '/packageMRC/pages/entry/index';
|
|
|
|
|
|
function findMrcEntries(menus) {
|
|
|
return menus.filter((menu) => String(menu.routePath || '').replace(/^\//, '') === MRC_ENTRY_ROUTE.slice(1));
|
|
|
@@ -14,12 +15,22 @@ const localEntries = findMrcEntries(localOnlyMenus);
|
|
|
assert.strictEqual(localEntries.length, 1, 'the MRC Demo entry must be available when the service API has no menu data');
|
|
|
assert.strictEqual(localEntries[0].name, '病案复印(Demo)');
|
|
|
assert.strictEqual(localEntries[0].whitelisted, true);
|
|
|
+assert.strictEqual(
|
|
|
+ localOnlyMenus.some((menu) => String(menu.routePath || '').replace(/^\//, '') === MRC_DEVELOPER_TOOL_ROUTE.slice(1)),
|
|
|
+ false,
|
|
|
+ 'the developer tool route must not be exposed through the patient-facing home menu'
|
|
|
+);
|
|
|
assert.strictEqual(isWhitelisted(MRC_ENTRY_ROUTE), true, 'the home-menu entry must use the existing whitelist dispatcher');
|
|
|
assert.deepStrictEqual(
|
|
|
lookupRoute(MRC_ENTRY_ROUTE),
|
|
|
{ path: MRC_ENTRY_ROUTE, type: 'navigateTo' },
|
|
|
'the home-menu entry must use the existing navigateTo dispatcher'
|
|
|
);
|
|
|
+assert.deepStrictEqual(
|
|
|
+ lookupRoute(MRC_DEVELOPER_TOOL_ROUTE),
|
|
|
+ { path: MRC_DEVELOPER_TOOL_ROUTE, type: 'navigateTo' },
|
|
|
+ 'the developer tool route remains available for internal Demo troubleshooting'
|
|
|
+);
|
|
|
|
|
|
const serverMenus = normalizeMenus({
|
|
|
rows: [{
|