Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shinytest compatibility - dashboardPage #118

Open
baxb94 opened this issue Mar 17, 2021 · 0 comments
Open

shinytest compatibility - dashboardPage #118

baxb94 opened this issue Mar 17, 2021 · 0 comments

Comments

@baxb94
Copy link

baxb94 commented Mar 17, 2021

When using the shinydashboard::sidebarMenu, shinytest is unable to identify the sidebar in the inputs. This only occurs when using the shinydashboardPlus::dashboardPage. When I print the shinytest listWidgets, there is no sidebar element in the inputs.

I have tried the following:
This works (using just shiny dashboard)
Code

shinydashboard::dashboardPage(
  sidebar = shinydashboard::dashboardSidebar(
    shinydashboard::sidebarMenu(
      id = "sidebar",
      ..
    )
  )
)

Output

print(app$listWidgets())
$input
 [1] "sidebarCollapsed"                 "sidebarItemExpanded"              "sidebar"    ...

This does not work (using plus dashboard page with normal sidebar):

shinydashboardPlus::dashboardPage(
  sidebar = shinydashboard::dashboardSidebar(
    shinydashboard::sidebarMenu(
      id = "sidebar",
      ..
    )
  )
)

Output

print(app$listWidgets())
$input
 [1]  ...

This does not work (using plus dashboard page with plus sidebar):

shinydashboardPlus::dashboardPage(
  sidebar = shinydashboardPlus::dashboardSidebar(
    shinydashboard::sidebarMenu(
      id = "sidebar",
      ..
    )
  )
)

Output

print(app$listWidgets())
$input
 [1]  ...

This does not work (using plus dashboard page with plus sidebar with id):

shinydashboardPlus::dashboardPage(
  sidebar = shinydashboardPlus::dashboardSidebar(
    id = "some-id",
    shinydashboard::sidebarMenu(
      id = "sidebar",
      ..
    )
  )
)

Output

print(app$listWidgets())
$input
 [1]  ...

Without compatibility with shinytest, it is making it impossible to run UI snapshot simulation tests using shinydashboardPlus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant