diff --git a/ecosystem-explorer/src/App.test.tsx b/ecosystem-explorer/src/App.test.tsx index 37cb15c75..7903eb471 100644 --- a/ecosystem-explorer/src/App.test.tsx +++ b/ecosystem-explorer/src/App.test.tsx @@ -14,14 +14,39 @@ * limitations under the License. */ import { render, screen } from "@testing-library/react"; -import { describe, it, expect } from "vitest"; +import { describe, it, expect, afterEach, vi } from "vitest"; import App from "./App"; +import { ThemeProvider } from "./theme-context"; describe("App", () => { - it("renders the page title", async () => { - render(); + afterEach(() => { + vi.unstubAllEnvs(); + }); + + it("renders the legacy app when V1_REDESIGN is disabled", async () => { + vi.stubEnv("VITE_FEATURE_FLAG_V1_REDESIGN", ""); + + render( + + + + ); + const heading = await screen.findByRole("heading", { level: 1 }); expect(heading).toHaveTextContent("OpenTelemetry"); expect(heading).toHaveTextContent("Ecosystem Explorer"); }); + + it("renders the v1 app when V1_REDESIGN is enabled", async () => { + vi.stubEnv("VITE_FEATURE_FLAG_V1_REDESIGN", "true"); + + const { container } = render( + + + + ); + + expect(await screen.findByLabelText("OpenTelemetry")).toBeInTheDocument(); + expect(container.querySelector(".v1-app")).not.toBeNull(); + }); }); diff --git a/ecosystem-explorer/src/App.tsx b/ecosystem-explorer/src/App.tsx index a1f65485e..47e255054 100644 --- a/ecosystem-explorer/src/App.tsx +++ b/ecosystem-explorer/src/App.tsx @@ -13,121 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { lazy, Suspense } from "react"; -import { BrowserRouter, Routes, Route } from "react-router-dom"; -import { Header } from "@/components/layout/header"; -import { Footer } from "@/components/layout/footer"; +import { BrowserRouter } from "react-router-dom"; +import { LegacyApp } from "@/LegacyApp"; +import { V1App } from "@/v1"; import { isEnabled } from "@/lib/feature-flags"; -import { ErrorBoundary } from "@/components/ui/error-boundary"; - -const HomePage = lazy(() => - import("@/features/home/home-page").then((m) => ({ default: m.HomePage })) -); -const JavaAgentPage = lazy(() => - import("@/features/java-agent/java-agent-page").then((m) => ({ default: m.JavaAgentPage })) -); -const CollectorPage = lazy(() => - import("@/features/collector/collector-page").then((m) => ({ default: m.CollectorPage })) -); -const CollectorDetailPage = lazy(() => - import("@/features/collector/collector-detail-page").then((m) => ({ - default: m.CollectorDetailPage, - })) -); -const NotFoundPage = lazy(() => - import("@/features/not-found/not-found-page").then((m) => ({ default: m.NotFoundPage })) -); -const JavaInstrumentationListPage = lazy(() => - import("@/features/java-agent/java-instrumentation-list-page").then((m) => ({ - default: m.JavaInstrumentationListPage, - })) -); -const JavaConfigurationListPage = lazy(() => - import("@/features/java-agent/java-configuration-list-page").then((m) => ({ - default: m.JavaConfigurationListPage, - })) -); -const JavaReleaseComparisonPage = lazy(() => - import("@/features/java-agent/java-release-comparison-page").then((m) => ({ - default: m.JavaReleaseComparisonPage, - })) -); -const InstrumentationDetailPage = lazy(() => - import("@/features/java-agent/instrumentation-detail-page").then((m) => ({ - default: m.InstrumentationDetailPage, - })) -); -const ConfigurationBuilderPage = lazy(() => - import("@/features/java-agent/configuration/configuration-builder-page").then((m) => ({ - default: m.ConfigurationBuilderPage, - })) -); -const AboutPage = lazy(() => - import("@/features/about/about-page").then((m) => ({ default: m.AboutPage })) -); +/* + * Single V1_REDESIGN boundary read. See + * `projects/84-ui-ux-design/v1-routing-pivot.md` for the routing pivot context. + * Both sub-apps share canonical paths under a single ; per-deploy + * bundle selection is driven by netlify.toml's `feat/84-*` branch pattern. + */ export default function App() { - return ( - -
-
-
- - -
Loading…
-
- } - > - - } /> - } /> - } - /> - } - /> - } - /> - } /> - {isEnabled("JAVA_RELEASE_COMPARISON") && ( - } /> - )} - {isEnabled("JAVA_CONFIG_BUILDER") && ( - } - /> - )} - } /> - {isEnabled("COLLECTOR_PAGE") && ( - <> - } /> - } /> - } - /> - - )} - } /> - } /> - - - - -