@@ -314,6 +314,45 @@ def test_confidence_intervals_missing_data_nones_in_values(
314314 assert main_bar_plot .error_y .array is not None
315315 assert main_bar_plot .error_y .arrayminus is not None
316316
317+ def test_confidence_intervals_missing_data_0_in_values (
318+ self , fake_plot_data : PlotGenerationData
319+ ):
320+ # Given
321+ chart_plots_data = [fake_plot_data ]
322+ chart_plots_data [0 ].parameters .chart_type = "bar"
323+ # Check that it works if there's a mix of 0 and Values
324+ fake_plot_data .additional_values = {
325+ "lower_confidence" : [0 ] * len (fake_plot_data .y_axis_values ),
326+ "upper_confidence" : [2 ] * len (fake_plot_data .y_axis_values ),
327+ }
328+ chart_payload = ChartGenerationPayload (
329+ chart_width = WIDTH ,
330+ chart_height = HEIGHT ,
331+ plots = chart_plots_data ,
332+ x_axis_title = "" ,
333+ y_axis_title = "" ,
334+ y_axis_minimum_value = 0 ,
335+ y_axis_maximum_value = None ,
336+ confidence_intervals = True ,
337+ confidence_colour = "BLUE" ,
338+ )
339+
340+ # When
341+ figure : plotly .graph_objects .Figure = generate_chart_figure (
342+ chart_generation_payload = chart_payload
343+ )
344+
345+ # Then
346+ # There should be 1 plot for the bar plot
347+ assert len (figure .data ) == 1
348+
349+ main_bar_plot : plotly .graph_objects .Bar = figure .data [0 ]
350+ # There should be a populated error object
351+ assert main_bar_plot .error_y .array is not None
352+ assert main_bar_plot .error_y .arrayminus == tuple (
353+ [value for value in fake_plot_data .y_axis_values ]
354+ )
355+
317356 def test_x_axis_type_is_not_date (self , fake_plot_data : PlotGenerationData ):
318357 """
319358 Given a list of x and y values where x values are NOT dates
0 commit comments