Skip to content

Commit

Permalink
tidying code
Browse files Browse the repository at this point in the history
- updating incidence to use component modules
- adding characterization UI tests
- fixing R check issues in char incidence
- updating resultTableServer manual
  • Loading branch information
jreps committed Aug 31, 2023
1 parent 7572855 commit c032db2
Show file tree
Hide file tree
Showing 9 changed files with 263 additions and 287 deletions.
500 changes: 219 additions & 281 deletions R/characterization-incidence.R

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion R/sccs-results-full.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ sccsFullResultViewer <- function(id) {

}


sccsFullResultServer <- function(
id,
connectionHandler,
Expand All @@ -122,7 +123,6 @@ sccsFullResultServer <- function(
"databaseName"
) %>%
dplyr::rename(
#'Target' = .data$covariateName,
'Outcome' = .data$outcome,
'Analysis' = .data$description,
'Database' = .data$databaseName
Expand Down
5 changes: 4 additions & 1 deletion man/resultTableServer.Rd

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

7 changes: 7 additions & 0 deletions tests/testthat/test-characterization-aggregate-features.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ shiny::testServer(
testthat::expect_true(!is.null(allData))

})


test_that("Test characterizationAggregateFeatures ui", {
# Test ui
ui <- characterizationAggregateFeaturesViewer(id = 'viewer')
checkmate::expect_list(ui)
})
6 changes: 6 additions & 0 deletions tests/testthat/test-characterization-cohorts.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ shiny::testServer(


})

test_that("Test characterizationTable ui", {
# Test ui
ui <- characterizationTableViewer(id = 'viewer')
checkmate::expect_list(ui)
})
6 changes: 6 additions & 0 deletions tests/testthat/test-characterization-dechallengeRechallenge.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ shiny::testServer(
##testthat::expect_true(!is.null(allData()))

})

test_that("Test characterizationDechallengeRechallenge ui", {
# Test ui
ui <- characterizationDechallengeRechallengeViewer(id = 'viewer')
checkmate::expect_list(ui)
})
15 changes: 12 additions & 3 deletions tests/testthat/test-characterization-incidence.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,17 @@ shiny::testServer(
testthat::expect_true(!is.null(cohorts$outcomeIds))

# check input$generate does not crash app
session$setInputs(targetId = 1)
session$setInputs(outcomeId = 3)
session$setInputs(generate = T)
session$setInputs(`input-selection_targetId` = 1)
session$setInputs(`input-selection_outcomeId` = 3)
session$setInputs(`input-selection_generate` = T)

})



test_that("Test characterizationIncidence ui", {
# Test ui
ui <- characterizationIncidenceViewer(id = 'viewer')
checkmate::expect_list(ui)
})

2 changes: 1 addition & 1 deletion tests/testthat/test-characterization-main.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ shiny::testServer(

test_that("Test characterization ui", {
# Test ui
ui <- characterizationViewer()
ui <- characterizationViewer(id = 'viewer')
checkmate::expect_list(ui)
})
7 changes: 7 additions & 0 deletions tests/testthat/test-characterization-timeToEvent.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ shiny::testServer(


})


test_that("Test characterizationTimeToEvent ui", {
# Test ui
ui <- characterizationTimeToEventViewer(id = 'viewer')
checkmate::expect_list(ui)
})

0 comments on commit c032db2

Please sign in to comment.