fix(zigbee): hide check method in modal, force none/online for zigbee nodes
Zigbee nodes have no IP-based check — hide Check Method and Check Target fields in NodeModal for all three zigbee types. Default and force check_method='none' so the scheduler marks them always online. Backend approve and zigbee import routes also set status='online' and check_method='none' for zigbee node types.
This commit is contained in:
@@ -433,4 +433,24 @@ describe('NodeModal', () => {
|
||||
const slider = screen.getByLabelText('Bottom connection points slider') as HTMLInputElement
|
||||
expect(slider.value).toBe('48')
|
||||
})
|
||||
|
||||
// ── Zigbee nodes ──────────────────────────────────────────────────────
|
||||
|
||||
const zigbeeTypes = ['zigbee_coordinator', 'zigbee_router', 'zigbee_enddevice'] as const
|
||||
|
||||
it.each(zigbeeTypes)('hides Check Method for %s type', (type) => {
|
||||
renderModal({ initial: { ...BASE, type } })
|
||||
expect(screen.queryByText('Check Method')).toBeNull()
|
||||
})
|
||||
|
||||
it.each(zigbeeTypes)('hides Check Target for %s type', (type) => {
|
||||
renderModal({ initial: { ...BASE, type } })
|
||||
expect(screen.queryByText('Check Target')).toBeNull()
|
||||
})
|
||||
|
||||
it.each(zigbeeTypes)('submits check_method=none for %s type', (type) => {
|
||||
const { onSubmit } = renderModal({ initial: { ...BASE, type, label: 'Zigbee Node' } })
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Add' }))
|
||||
expect((onSubmit.mock.calls[0][0] as Partial<NodeData>).check_method).toBe('none')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user