M8-T18: add source and multi-commodity meter UI

This commit is contained in:
2026-08-23 21:22:06 +02:00
parent 39c11ae606
commit 963e43e3e4
15 changed files with 319 additions and 18 deletions
+14
View File
@@ -15,6 +15,7 @@
import { describe, it, expect, vi, beforeEach } from 'vitest'
import { screen, waitFor, fireEvent } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { renderWithProviders } from '../test-utils'
import { EnergyPage } from './EnergyPage'
@@ -135,6 +136,19 @@ describe('EnergyPage — device list', () => {
})
})
describe('EnergyPage — M8 navigation labels', () => {
beforeEach(() => { vi.clearAllMocks(); setupDefaultMocks() })
it('has keyboard-operable Sources, Modbus Devices and Meters tabs, without a DSMR tab', async () => {
const user = userEvent.setup(); renderEnergy()
const sources = screen.getByRole('tab', { name: 'Sources' })
expect(screen.getByRole('tab', { name: 'Modbus Devices' })).toBeInTheDocument()
expect(screen.getByRole('tab', { name: 'Meters' })).toBeInTheDocument()
expect(screen.queryByRole('tab', { name: /^DSMR$/ })).not.toBeInTheDocument()
sources.focus(); await user.keyboard('{Enter}')
expect(await screen.findByTestId('panel-sources')).toBeInTheDocument()
})
})
describe('EnergyPage — create device', () => {
beforeEach(() => {
vi.clearAllMocks()