diff --git a/ui-tests/test/settings.spec.ts b/ui-tests/test/settings.spec.ts new file mode 100644 index 00000000..ff811b8e --- /dev/null +++ b/ui-tests/test/settings.spec.ts @@ -0,0 +1,31 @@ +// Copyright (c) Jupyter Development Team. +// Distributed under the terms of the Modified BSD License. + +import { test } from './fixtures'; + +import { expect } from '@playwright/test'; + +test.use({ autoGoto: false }); + +test.describe('Settings', () => { + test('Should be persisted after reloading the page', async ({ + page, + tmpPath + }) => { + const showHeaderPath = 'View>Show Header'; + + await page.goto(`tree/${tmpPath}`); + + await page.menu.clickMenuItem(showHeaderPath); + await page.reload({ waitUntil: 'networkidle' }); + + await page.menu.getMenuItem(showHeaderPath); + expect(await page.screenshot()).toMatchSnapshot('top-hidden.png'); + + await page.menu.clickMenuItem(showHeaderPath); + await page.reload({ waitUntil: 'networkidle' }); + + await page.menu.getMenuItem(showHeaderPath); + expect(await page.screenshot()).toMatchSnapshot('top-visible.png'); + }); +}); diff --git a/ui-tests/test/settings.spec.ts-snapshots/top-hidden-chromium-linux.png b/ui-tests/test/settings.spec.ts-snapshots/top-hidden-chromium-linux.png new file mode 100644 index 00000000..d8a4cf43 Binary files /dev/null and b/ui-tests/test/settings.spec.ts-snapshots/top-hidden-chromium-linux.png differ diff --git a/ui-tests/test/settings.spec.ts-snapshots/top-hidden-firefox-linux.png b/ui-tests/test/settings.spec.ts-snapshots/top-hidden-firefox-linux.png new file mode 100644 index 00000000..684743f2 Binary files /dev/null and b/ui-tests/test/settings.spec.ts-snapshots/top-hidden-firefox-linux.png differ diff --git a/ui-tests/test/settings.spec.ts-snapshots/top-visible-chromium-linux.png b/ui-tests/test/settings.spec.ts-snapshots/top-visible-chromium-linux.png new file mode 100644 index 00000000..7ad0488e Binary files /dev/null and b/ui-tests/test/settings.spec.ts-snapshots/top-visible-chromium-linux.png differ diff --git a/ui-tests/test/settings.spec.ts-snapshots/top-visible-firefox-linux.png b/ui-tests/test/settings.spec.ts-snapshots/top-visible-firefox-linux.png new file mode 100644 index 00000000..778a6fff Binary files /dev/null and b/ui-tests/test/settings.spec.ts-snapshots/top-visible-firefox-linux.png differ