Skip to content

Commit

Permalink
- add a test to check if the app starts
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-enzlein committed Jun 6, 2024
1 parent 6bad17e commit 772a592
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ server <- function(input, output, session) {
exportTestValues(numSpec = length(appData$spec_all),
isSpectrumList = MALDIquant::isMassSpectrumList(appData$spec_all),
infoState = appData$info_state,
info3 = output$info3,
pca = appData$pca,
clust = appData$clust)

Expand Down
20 changes: 20 additions & 0 deletions tests/testthat/test_0startApp.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
test_that("App starts.", {
setwd(dirname(common::file.find(pattern = "req.txt")))
# make sure settings.csv is not present
if(file.exists("settings.csv")) {
fs::file_delete("settings.csv")
}

library(shinytest2)
options(shiny.testmode = TRUE)

app <- AppDriver$new(app_dir = getwd(),
name = "M2ara_bruker load test",
seed = 42,
timeout = 4.5*1e5)

exp <- app$get_values(export = TRUE)

expect_equal(exp$export$infoState, "inital")
expect_equal(exp$export$info3, "")
})

0 comments on commit 772a592

Please sign in to comment.