insightsengineering / insightsengineering/teal.modules.general

[Bug]: tm_a_regression serverTests fail when verifying plot objects

Open
#971 1 comment 0 reactions 0 assignees View on GitHub
bug core
Dominant language
R
Stars
16
Forks
23
PR merge metrics
No merged PRs in 30d

Description

### What happened?

In [previous attempts to create `testServer` scenarios](https://github.com/insightsengineering/teal.modules.general/commit/e285c55a2df29bca5a838e6ceb455f03e85dbe23) for module tm_a_regression the test pass when we call them using `devtools::test()` or similar but fail when called by `covr::package_coverage`.

The output error when using `package_coverage` is:
```
Error in `current[[1L]]`: object of type 'symbol' is not subsettable`
```

Tips to reproduce this issue:

1. Add verifications of output in one `testServer`:
```
output_result <- output_q()
testthat::expect_true(inherits(output_result, "teal_data"))
plot_result <- plot_r()
```

2. Comment all other test in `test-tm_a_regression.R`
3. Remove (temporarly) all other test files from folder `tests/testthat` but keep helper functions. (Hint in terminal:
```
mv test-tm_a_regression.R ../test-tm_a_regression.R
rm test*.R
mv ../test-tm_a_regression.R ./
```
4. Run `covr::package_coverage(clean = FALSE)`

Also of your interest:

- The error might be comming from [this section](https://github.com/insightsengineering/teal.modules.general/blob/main/R/tm_a_regression.R#L537-L540) of the module
- There was a [similar error](https://github.com/insightsengineering/teal.modules.general/pull/966#issuecomment-3800048502) in another test file.

### sessionInfo()

```R

```

### Relevant log output

```R

```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct.

### Contribution Guidelines

- [x] I agree to follow this project's Contribution Guidelines.

### Security Policy

- [x] I agree to follow this project's Security Policy.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.