Skip to content

Commit

Permalink
Add test for GH issue #8127
Browse files Browse the repository at this point in the history
Confirms this bug was the same as #8165

Fixes #8127
  • Loading branch information
mjackson committed Oct 27, 2021
1 parent af9228e commit 3485453
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/react-router/__tests__/gh-issue-8127-test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import * as React from "react";
import { act, create as createTestRenderer } from "react-test-renderer";
import { MemoryRouter, Routes, Route } from "react-router-dom";

describe("GH Issue #8127", () => {
it("works", () => {
let renderer;
act(() => {
renderer = createTestRenderer(
<MemoryRouter initialEntries={["/availability"]}>
<Routes>
<Route
path="*"
element={
<Routes>
<Route path="*" element={<h1>sub splat</h1>} />
<Route path="availability" element={<h1>availability</h1>} />
</Routes>
}
/>
</Routes>
</MemoryRouter>
);
});

expect(renderer.toJSON()).toMatchInlineSnapshot(`
<h1>
availability
</h1>
`);
});
});

0 comments on commit 3485453

Please sign in to comment.