import { expect, test } from '@playwright/test';

test('legacy /ws welcome route redirects to the public home page', async ({
  page,
}) => {
  await page.goto('/ws#route=welcome');
  await expect(page).toHaveURL(/\/$/);
  expect(new URL(page.url()).pathname).toBe('/');
  expect(new URL(page.url()).hash).toBe('');
});

test('editor deep links containing welcome text remain editor deep links', async ({
  page,
}) => {
  await page.goto('/ws#route=editor&wsPath=notes%3Awelcome.md');
  await expect(page).toHaveURL(/\/ws#route=editor/);
});
