library(stocktipr6)
#>
#> Attaching package: 'stocktipr6'
#> The following object is masked from 'package:base':
#>
#> %||%
tests/testthat/ Directory (Test Suite)
Comprehensive test coverage across 7 test files:
-
test_mod_inputs.R- 7 test cases- R6 instantiation, UI structure, namespace IDs, server reactives, isolation
-
test_mod_outputs.R- 6 test cases- R6 instantiation, UI structure with 5 tabs, namespace IDs, reactive performance tibble
-
test_mod_download.R- 6 test cases- R6 instantiation, server integration with reactives, namespace isolation, UI/server ID matching, report rendering
-
test_utils_data.R- 11 test cases- Log return computation, NA handling, performance metrics, rolling volatility
-
test_utils_logging.R- 7 test cases- Expression execution, error re-throwing, warning suppression, null-coalescing operator
-
test_mod_tooltip.R- 10 test cases- Backend dispatching (
bslib,shinyhelper,prompter,shinyalert), style/size parameters
- Backend dispatching (
-
test_mod_hoverinfo.R- 11 test cases- Span tag generation, title attributes, named vectors, style/size handling
Total Test Cases: 58
Coverage
| Category | Test File | Test Cases |
|---|---|---|
| R6 Classes | test_mod_inputs.R |
7 |
test_mod_outputs.R |
6 | |
test_mod_download.R |
6 | |
| Data Utilities | test_utils_data.R |
11 |
| Logging | test_utils_logging.R |
7 |
| UI Helpers | test_mod_tooltip.R |
10 |
test_mod_hoverinfo.R |
11 | |
| Total | 7 files | 58 tests |
Test Patterns Used
- Unit Tests: Direct function/method calls with assertions
-
Shiny-Specific Tests:
shiny::testServer()for reactive logic - Integration Tests: R6 module composition and data flow
- Error Handling: Validation of error messages and edge cases