diff --git a/galata/test/documentation/general.test.ts-snapshots/jupyterlab-documentation-linux.png b/galata/test/documentation/general.test.ts-snapshots/jupyterlab-documentation-linux.png index 9c6aab81d9b7..bbd20712f85b 100644 Binary files a/galata/test/documentation/general.test.ts-snapshots/jupyterlab-documentation-linux.png and b/galata/test/documentation/general.test.ts-snapshots/jupyterlab-documentation-linux.png differ diff --git a/galata/test/jupyterlab/launcher.test.ts b/galata/test/jupyterlab/launcher.test.ts new file mode 100644 index 000000000000..901f7a3ecc95 --- /dev/null +++ b/galata/test/jupyterlab/launcher.test.ts @@ -0,0 +1,46 @@ +// Copyright (c) Jupyter Development Team. +// Distributed under the terms of the Modified BSD License. + +import { expect, galata, test } from '@jupyterlab/galata'; + +test.use({ + autoGoto: false, + mockState: galata.DEFAULT_DOCUMENTATION_STATE, + viewport: { height: 720, width: 1280 } +}); + +test.describe('Dynamic Text Spacing', () => { + test('should Use Dynamic Text Spacing', async ({ page }) => { + await page.goto(); + await page.waitForSelector('.jp-LauncherCard-label'); + + let element = page.locator('div.jp-LauncherCard-label'); + for (let i = 0; i < (await element.count()); i++) { + let height = await element + .nth(i) + .evaluate(el => + window.getComputedStyle(el).getPropertyValue('min-height') + ); + + let expectedValue = + 2.462 * + parseFloat( + await element + .nth(i) + .evaluate(el => + window + .getComputedStyle(el) + .getPropertyValue('font-size') + .toString() + ) + ); + + expect(height).toEqual(expectedValue + 'px'); + } + + const imageName = 'launcher-card-label-height.png'; + expect( + await page.locator('.jp-Launcher-content').screenshot() + ).toMatchSnapshot(imageName.toLowerCase()); + }); +}); diff --git a/galata/test/jupyterlab/launcher.test.ts-snapshots/launcher-card-label-height-jupyterlab-linux.png b/galata/test/jupyterlab/launcher.test.ts-snapshots/launcher-card-label-height-jupyterlab-linux.png new file mode 100644 index 000000000000..ebc48ff5cb44 Binary files /dev/null and b/galata/test/jupyterlab/launcher.test.ts-snapshots/launcher-card-label-height-jupyterlab-linux.png differ