@@ -48,6 +48,10 @@ x_plot_type <- "ULN"
4848y_plot_type <- " Baseline"
4949x_ref_line_num <- 3
5050y_ref_line_num <- 2
51+ x_rng_lower <- 0
52+ x_rng_upper <- 10
53+ y_rng_lower <- 0
54+ y_rng_upper <- 10
5155
5256# Invoke the function
5357plt_obj <- generate_plot(
@@ -60,7 +64,11 @@ plt_obj <- generate_plot(
6064 x_plot_type = x_plot_type ,
6165 y_plot_type = y_plot_type ,
6266 x_ref_line_num = x_ref_line_num ,
63- y_ref_line_num = y_ref_line_num
67+ y_ref_line_num = y_ref_line_num ,
68+ x_rng_lower = x_rng_lower ,
69+ x_rng_upper = x_rng_upper ,
70+ y_rng_lower = y_rng_lower ,
71+ y_rng_upper = y_rng_upper
6472)
6573
6674# Tests
@@ -110,6 +118,16 @@ test_that("the resulting plot object includes the correct reference lines" %>%
110118 expect_identical(actual_y1 , y_ref_line_num )
111119})
112120
121+ test_that(" the resulting plot object includes the correct axis range" %> %
122+ vdoc [[" add_spec" ]](specs $ plot_specs $ axis_labels ), {
123+ actual_x <- plt_obj $ x $ layoutAttrs [[1 ]]$ xaxis $ range
124+ actual_y <- plt_obj $ x $ layoutAttrs [[1 ]]$ yaxis $ range
125+ expected_x <- c(x_rng_lower , x_rng_upper + 0.005 )
126+ expected_y <- c(y_rng_lower , y_rng_upper + 0.005 )
127+ expect_identical(actual_x , expected_x )
128+ expect_identical(actual_y , expected_y )
129+ })
130+
113131test_that(" the resulting plot object includes the correct coloring" %> %
114132 vdoc [[" add_spec" ]](specs $ plot_specs $ arm_coloring ), {
115133 actual <- plt_obj $ x $ attrs [[1 ]]$ color
0 commit comments