Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ RoxygenNote: 7.3.2
Encoding: UTF-8
BugReports: https://github.com/statnet/statnetWeb/issues
URL: https://statnet.org, https://github.com/statnet/statnetWeb
Suggests:
testthat (>= 3.0.0),
shinytest2
Config/testthat/edition: 3
2 changes: 1 addition & 1 deletion inst/shiny/statnetWeb/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ output$datadesc <- renderUI({
text
})

output$rawdatafile <- renderPrint({
output$rawdata_stats <- renderPrint({
raw <- matrix(nrow=2,ncol=1)
rownames(raw)<-c("name:", "size:")
if(!is.null(input$rawdatafile)){
Expand Down
1 change: 1 addition & 0 deletions inst/shiny/statnetWeb/tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shinytest2::test_app()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions inst/shiny/statnetWeb/tests/testthat/setup-shinytest2.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Load application support files into testing environment
shinytest2::load_app_env()
9 changes: 9 additions & 0 deletions inst/shiny/statnetWeb/tests/testthat/test-shinytest2.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
library(shinytest2)

test_that("{shinytest2} recording: load-flobusiness", {
app <- AppDriver$new(variant = platform_variant(), name = "load-flobusiness", height = 770,
width = 1165)
app$set_inputs(navbar = "tab2")
app$set_inputs(samplenet = "flobusiness")
app$expect_screenshot()
})
3 changes: 2 additions & 1 deletion inst/shiny/statnetWeb/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ fluidRow(
column(6,
br(),
fileInput(inputId='rawdatafile', label=NULL, accept='text'),
verbatimTextOutput('rawdatafile'))
verbatimTextOutput('rawdata_stats')
)
),
conditionalPanel(condition = 'input.filetype == 5',
column(6,
Expand Down
12 changes: 12 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
# * https://testthat.r-lib.org/articles/special-files.html

library(testthat)
library(statnetWeb)

test_check("statnetWeb")
11 changes: 11 additions & 0 deletions tests/testthat/test-statnetWeb-app.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
library(shinytest2)

test_that("statnetWeb app works", {
# Don't run these tests on CRAN
# skip_on_cran()
expect_true(TRUE)

app_path <- "../../inst/shiny/statnetWeb"
# testthat::expect_identical(app_path, 1)
test_app(app_path, check_setup = TRUE)
})
Loading