From 21fe84083c7b85718f712d171606e395d7e71ac2 Mon Sep 17 00:00:00 2001 From: Jakub Sobolewski Date: Fri, 30 Jun 2023 11:12:45 +0200 Subject: [PATCH] fix: E2E dashboard test --- inst/examples/dashboard/examples.R | 15 +++++++-------- js/cypress/integration/dashboard/dashboard.cy.js | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/inst/examples/dashboard/examples.R b/inst/examples/dashboard/examples.R index 33ae6655..d6c2012e 100644 --- a/inst/examples/dashboard/examples.R +++ b/inst/examples/dashboard/examples.R @@ -113,14 +113,13 @@ makeExamplePage <- function(name, example) { } makeLiveExamplePage <- function(example, id) { - tagList( - makeCard( - title = Text("Live example", variant = "large"), - content = tagList( - example$ui(id), - Separator(), - pre(example$code) - ) + makeCard( + title = Text("Live example", variant = "large"), + content = div( + id = id, + example$ui(id), + Separator(), + pre(example$code) ) ) } diff --git a/js/cypress/integration/dashboard/dashboard.cy.js b/js/cypress/integration/dashboard/dashboard.cy.js index 200b31ed..7b2ec9ba 100644 --- a/js/cypress/integration/dashboard/dashboard.cy.js +++ b/js/cypress/integration/dashboard/dashboard.cy.js @@ -3,14 +3,14 @@ describe('Dashboard', () => { cy.visit('http://localhost:8889/#!/Slider'); const steps = 15; const arrows = '{rightarrow}'.repeat(steps); - cy.get('.ms-Slider-slideBox') + cy.get('#Slider .ms-Slider-slideBox') .focus() .type(arrows); cy.contains('Value: 15'); }); it('Dropdown', () => { cy.visit('http://localhost:8889/#!/Dropdown'); - cy.get('.ms-Dropdown-title').click(); + cy.get('#Dropdown .ms-Dropdown-title').click(); cy.get('.ms-Dropdown-item').contains('Option C').click(); cy.contains('Value: C'); });