Skip to content

Commit

Permalink
Minor bug fixes and typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
janlisec committed Mar 27, 2024
1 parent a352599 commit 5dd04ec
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion R/fnc_assert_col.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#'str(assert_col(df = x, name = "Analyte", pos = 3, type = "character"))
#'str(assert_col(df = x, name = " Analyte", pos = 2, type = "factor"))
#'str(assert_col(df = x, name = "Analyte", pos = 2, type = "factor", fuzzy_name = FALSE))
#'str(assert_col(df = x, name = "Analyte", type = "factor", fuzzy_name = FALSE, default_value = "test"))
#'str(assert_col(df = x, name = "test", type = "factor", default_value = "test"))
#'str(assert_col(df = x, name = "unit", type = "numeric", default_value = "test"))
#'str(assert_col(df = x, name = "unit", type = "numeric", default_value = 10))
#'str(assert_col(df = x, name = "unit", type = "Date"))
Expand Down
8 changes: 4 additions & 4 deletions R/m_ExcelUpload.R
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ m_ExcelUpload_Server <- function(id, rv = NULL, msession = NULL) {
} else {
# (3) as a dataframe giving Temp info additionally to compute Arrhenius estimate of uncertainty
s_dat <- tab_flt[[as.numeric(input$sheet_number)]]
assert_col(df = s_dat, name = "Temp", type = "numeric")
s_dat <- assert_col(df = s_dat, name = "Temp", type = "numeric")
}
}
assert_col(df = s_dat, name = "analyte", type = "factor")
assert_col(df = s_dat, name = "Value", type = "numeric")
assert_col(df = s_dat, name = "Date", type = "Date")
s_dat <- assert_col(df = s_dat, name = "analyte", type = "factor")
s_dat <- assert_col(df = s_dat, name = "Value", type = "numeric")
s_dat <- assert_col(df = s_dat, name = "Date", type = "Date")
s_dat[,"time"] <- as.numeric(s_dat[,"Date"]-min(s_dat[,"Date"]))
load_result <- s_dat
}
Expand Down
2 changes: 1 addition & 1 deletion man/assert_col.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file modified tests/testthat/_snaps/page_start/page_start-001_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion tests/testthat/test-ExcelUpload.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
testthat::local_edition(3)
# testthat::test_file(path = "tests/testthat/test-ExcelUpload.R")

# Certification Test ------------------------------------------------------
testthat::test_that(
Expand Down Expand Up @@ -98,10 +99,11 @@ testthat::test_that(
session$setInputs(moduleSelect = "Stability", excel_file = xlsx_test, sheet_number = 1, file_number = 1, file_name = "Stability_Testdata.xlsx")
session$flushReact()
session$setInputs(btn_load = "click")
# $$JL$$ upload module was changed to respect analyte order from Excel file
# $$JL$$ upload module was changed to respect analyte order from Excel file and to incorporate column time
# original test data have to be modified to reflect this change
comp <- eCerto:::test_Stability_Excel()
comp[,"analyte"] <- factor(comp[,"analyte"], levels=c("Si","Mn"))
comp[,"time"] <- as.numeric(comp[,"Date"]-min(comp[,"Date"]))
testthat::expect_equal(out$data, comp)
}
)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-page_start.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# testthat::test_file(path = "tests/testthat/test-page_start.R")
testthat::test_that(
desc = "page_start works",
code = {
Expand Down

0 comments on commit 5dd04ec

Please sign in to comment.