M8-T18: add source and multi-commodity meter UI
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user