Add energy tracker (/projects/energy)
Public, read-only page over the ned-collector energy schema: latest-hour mix and per-source utilization, generation vs consumption with CO2 intensity (day/week/month/12 months/all years), NED forecast, gas storage by year and per site, and gas-fired power share vs storage fill. Incomplete hours (sources not summing to the NED total) are left out and partial days/months/years are marked.
This commit is contained in:
17
tests/energy.test.ts
Normal file
17
tests/energy.test.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test('energy tracker renders its charts and is listed under trackers', async ({ page }) => {
|
||||
await page.goto('/projects/energy');
|
||||
await expect(page.getByRole('heading', { level: 1, name: 'Energy' })).toBeVisible();
|
||||
await expect(page.getByRole('heading', { name: 'Generation and consumption' })).toBeVisible();
|
||||
await expect(page.locator('canvas').first()).toBeVisible();
|
||||
for (const range of ['day', 'month', '12 months', 'all years']) {
|
||||
await page.getByRole('tab', { name: range, exact: true }).click();
|
||||
await expect(page.getByRole('tab', { name: range, exact: true })).toHaveAttribute(
|
||||
'data-state',
|
||||
'active'
|
||||
);
|
||||
}
|
||||
await page.goto('/trackers');
|
||||
await expect(page.locator('a[href="/projects/energy"]').first()).toBeVisible();
|
||||
});
|
||||
Reference in New Issue
Block a user