import { describe, it, expect } from "vitest"; import nextConfig from "./next.config"; // merge-inventory-page: the five stock pages became tabs/forms on /inventory; bookmarks redirect. describe("inventory redirects", () => { it("sends the five old routes to the Inventory page, temporarily", async () => { const redirects = await nextConfig.redirects!(); expect(redirects).toEqual( expect.arrayContaining([ { source: "/inventory/stock-on-hand", destination: "/inventory", permanent: false }, { source: "/inventory/movement-history", destination: "/inventory?tab=history", permanent: false }, { source: "/inventory/stock-in", destination: "/inventory?action=stock-in", permanent: false }, { source: "/inventory/transfers", destination: "/inventory?action=transfer", permanent: false }, { source: "/inventory/adjustments", destination: "/inventory?action=adjust", permanent: false }, ]), ); }); it("does not redirect Delivery Orders", async () => { const redirects = await nextConfig.redirects!(); expect(redirects.some(r => r.source.startsWith("/inventory/delivery-orders"))).toBe(false); }); });