feat: v0.3.1 — show app version in header (sourced from package.json)
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { test, expect, type Page } from '@playwright/test';
|
||||
|
||||
const APP_URL = '/';
|
||||
|
||||
// Read at test time so the assertion tracks package.json automatically.
|
||||
const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8')) as { version: string };
|
||||
|
||||
// Must match MIN_ZOOM / MAX_ZOOM exported from components/Map.tsx.
|
||||
const MIN_ZOOM = 3;
|
||||
const MAX_ZOOM = 11;
|
||||
@@ -24,6 +29,12 @@ test('page loads with the map and EU airport count', async ({ page }) => {
|
||||
expect(count).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('header shows the app version sourced from package.json', async ({ page }) => {
|
||||
await page.goto(APP_URL);
|
||||
const header = page.getByTestId('app-header');
|
||||
await expect(header).toContainText(`v${pkg.version}`);
|
||||
});
|
||||
|
||||
test('clicking an airport marker opens a popup with name and ICAO', async ({ page }) => {
|
||||
await page.goto(APP_URL);
|
||||
await waitForAirportCount(page);
|
||||
|
||||
Reference in New Issue
Block a user