Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: useSubmitImpl() not respects incoming query search when using POST #931

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
- hzhu
- IAmLuisJ
- ianduvall
- jacargentina
- imzshh
- IshanKBG
- jacob-ebey
Expand Down
27 changes: 27 additions & 0 deletions fixtures/gists-app/tests/nested-form-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { Browser, Page } from "puppeteer";
import puppeteer from "puppeteer";

import { reactIsHydrated } from "./utils";

const testPort = 3000;
const testServer = `http://localhost:${testPort}`;

describe("nested form", () => {
let browser: Browser;
let page: Page;
beforeEach(async () => {
browser = await puppeteer.launch();
page = await browser.newPage();
});

afterEach(() => browser.close());

it("keep query string on post", async () => {
await page.goto(`${testServer}/nested-forms?q=1`);
await reactIsHydrated(page);

const originalUrl = page.url();
await page.click("button[type=submit]");
expect(page.url()).toEqual(originalUrl);
});
});