Skip to content

Commit

Permalink
add test for missing output voltage
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandawg93 committed Jan 31, 2025
1 parent badf0b7 commit f565530
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions __tests__/unit/client/components/line-chart.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,20 @@ describe('Line', () => {

expect(getByTestId('volts-chart')).toBeInTheDocument()
})

it('renders with no output voltage', () => {
const vars = { ...device.vars }
delete vars['output.voltage']
const { getByTestId } = render(
<VoltsChart
id={device.name}
inputVoltage={+vars['input.voltage'].value}
inputVoltageNominal={+vars['input.voltage.nominal']?.value}
outputVoltage={+vars['output.voltage']?.value}
updated={new Date()}
/>
)

expect(getByTestId('volts-chart')).toBeInTheDocument()
})
})

0 comments on commit f565530

Please sign in to comment.