Skip to content

Commit

Permalink
[chore] simplify test for external link (#8424)
Browse files Browse the repository at this point in the history
* [chore] simplify test for external link

* stupid playwright

* check url still
  • Loading branch information
benmccann authored Jan 10, 2023
1 parent c8eff9a commit 57e8d1a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/kit/test/apps/basics/test/client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -789,19 +789,15 @@ test.describe('Routing', () => {
});

test('does not normalize external path', async ({ page }) => {
/** @type {Array<string|undefined>} */
const urls = [];

const { port, close } = await start_server((req, res) => {
if (req.url !== '/favicon.ico') urls.push(req.url);
res.end('ok');
const { port, close } = await start_server((_req, res) => {
res.end('<html><head></head><body>ok</body></html>');
});

try {
await page.goto(`/routing/slashes?port=${port}`);
await page.locator(`a[href="http://localhost:${port}/with-slash/"]`).click();

expect(urls).toEqual(['/with-slash/']);
expect(await page.content()).toBe('<html><head></head><body>ok</body></html>');
expect(page.url()).toBe(`http://localhost:${port}/with-slash/`);
} finally {
await close();
}
Expand Down

0 comments on commit 57e8d1a

Please sign in to comment.