"use strict"; const assert = require("node:assert/strict"); const fs = require("node:fs"); const path = require("node:path"); const test = require("node:test"); const repositoryRoot = path.resolve(__dirname, "..", ".."); const webRoot = path.join(repositoryRoot, "src", "MBN_STOCK_WEBVIEW.LegacyParityApp", "Web"); const markup = fs.readFileSync(path.join(webRoot, "index.html"), "utf8"); const app = fs.readFileSync(path.join(webRoot, "app.js"), "utf8"); const styles = fs.readFileSync(path.join(webRoot, "styles.css"), "utf8"); const modalFocus = fs.readFileSync(path.join(webRoot, "legacy-modal-focus.js"), "utf8"); const inputSmoke = fs.readFileSync(path.join( repositoryRoot, "scripts", "Test-LegacyPackageInput.mjs"), "utf8"); function section(source, startMarker, endMarker) { const start = source.indexOf(startMarker); assert.notEqual(start, -1, "missing start marker: " + startMarker); const end = source.indexOf(endMarker, start + startMarker.length); assert.ok(end > start, "missing end marker: " + endMarker); return source.slice(start, end); } function navButton(tabId) { const match = markup.match(new RegExp( `]*data-tab-id="${tabId}"[\\s\\S]*?<\\/button>`)); assert.ok(match, "missing navigation button: " + tabId); return match[0]; } test("GraphE and FSell or VI expose the original visible exit controls", () => { assert.match(markup, /id="manual-financial-workspace"[\s\S]*?