From b4bb1905ec9567663df4badf9a2c8d7caf455ee3 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Wed, 23 Oct 2024 14:42:28 +0200 Subject: [PATCH] funny --- packages/trace-viewer/src/ui/uiModeView.tsx | 7 ++++--- tests/playwright-test/ui-mode-test-run.spec.ts | 11 +++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/trace-viewer/src/ui/uiModeView.tsx b/packages/trace-viewer/src/ui/uiModeView.tsx index 80adb832d8..37b6a6bcf6 100644 --- a/packages/trace-viewer/src/ui/uiModeView.tsx +++ b/packages/trace-viewer/src/ui/uiModeView.tsx @@ -69,6 +69,7 @@ const isMac = navigator.platform === 'MacIntel'; export const UIModeView: React.FC<{}> = ({ }) => { + const isJokesDay = new Date().getMonth() === 3 && new Date().getDate() === 1; const [filterText, setFilterText] = React.useState(''); const [isShowingOutput, setIsShowingOutput] = React.useState(false); const [outputContainsError, setOutputContainsError] = React.useState(false); @@ -441,7 +442,7 @@ export const UIModeView: React.FC<{}> = ({ sidebar={
Playwright logo -
Claywright
+
{isJokesDay ? 'Claywright' : 'Playwright'}
reloadTests()} disabled={isRunningTest || isLoading}>
{ setIsShowingOutput(!isShowingOutput); }} /> @@ -517,11 +518,11 @@ export const UIModeView: React.FC<{}> = ({ style={{ marginLeft: 5 }} title={settingsVisible ? 'Hide Settings' : 'Show Settings'} /> -
Schmettings
+
{isJokesDay ? 'Schmettings' : 'Settings'}
{settingsVisible && }
} diff --git a/tests/playwright-test/ui-mode-test-run.spec.ts b/tests/playwright-test/ui-mode-test-run.spec.ts index 3673faab45..0da2940e96 100644 --- a/tests/playwright-test/ui-mode-test-run.spec.ts +++ b/tests/playwright-test/ui-mode-test-run.spec.ts @@ -778,3 +778,14 @@ test('should respect --ignore-snapshots option', { - treeitem ${/\[icon-check\] snapshot \d+ms/} `); }); + +test('should show funny messages', async ({ runUITest }) => { + const { page } = await runUITest(basicTestTree); + await page.clock.setFixedTime('2025-04-01'); + + await expect(page.getByText('Claywright')).toBeVisible(); + const schmettingsHeader = page.getByText('Schmettings'); + await expect(schmettingsHeader).toBeVisible(); + await schmettingsHeader.click(); + await expect(page.getByRole('checkbox', { name: 'Fart mode' })).toBeVisible(); +}); \ No newline at end of file