M5-T07: add latest-reading cards and Recharts trend charts; readings return most-recent rows

This commit is contained in:
2026-06-22 14:17:59 +02:00
parent 2dc469274a
commit 68165f0e01
13 changed files with 1454 additions and 23 deletions
+6 -2
View File
@@ -107,9 +107,13 @@ describe('EnergyPage — device list', () => {
expect(screen.getByTestId('devices-table')).toBeInTheDocument()
})
expect(screen.getByText('SDM120 Main')).toBeInTheDocument()
// Device name appears in multiple places now (table row + readings section + chart title).
const nameElements = screen.getAllByText('SDM120 Main')
expect(nameElements.length).toBeGreaterThan(0)
expect(screen.getByText('192.168.1.100')).toBeInTheDocument()
expect(screen.getByText('sdm120')).toBeInTheDocument()
// 'sdm120' may also appear in multiple places (table badge + chart).
const profileElements = screen.getAllByText('sdm120')
expect(profileElements.length).toBeGreaterThan(0)
})
it('shows empty state when no devices', async () => {