M5-T07: add latest-reading cards and Recharts trend charts; readings return most-recent rows
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user