Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions test/repro-5088-best-practices-layers.test.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { describe, it, expect } from "vitest";
import fs from "node:fs";
import path from "node:path";
import { describe, expect, it } from "vitest";

// Regression for issue #5088: docs/security/best-practices.mdx described
// "four layers" in the intro, the Mermaid diagram, and the at-a-glance table,
// but the body documents five layer sections (it adds Gateway Authentication).
// It also linked Sandbox Hardening through the wrong directory
// (manage-sandboxes/ rather than the canonical deployment/ path).
// It also keeps the Sandbox Hardening link on the canonical
// manage-sandboxes/ route rather than the retired deployment/ path.
const REPO_ROOT = path.dirname(import.meta.dirname);
const DOC = path.join(REPO_ROOT, "docs", "security", "best-practices.mdx");
const text = fs.readFileSync(DOC, "utf-8");

describe("best-practices.mdx security-layer consistency (#5088)", () => {
it("links Sandbox Hardening via the canonical deployment path", () => {
expect(text).not.toMatch(/manage-sandboxes\/sandbox-hardening/);
expect(text).toMatch(/\.\.\/deployment\/sandbox-hardening/);
it("links Sandbox Hardening via the canonical manage-sandboxes path", () => {
expect(text).toMatch(/\.\.\/manage-sandboxes\/sandbox-hardening/);
expect(text).not.toMatch(/\.\.\/deployment\/sandbox-hardening/);
});

it("intro and at-a-glance agree with the body's five layer sections", () => {
Expand Down