Skip to content

Commit c1a11a1

Browse files
committed
Updating tests
1 parent 649c856 commit c1a11a1

File tree

6 files changed

+20
-5
lines changed

6 files changed

+20
-5
lines changed

tests/playwright/shiny/bugs/2061-css-js-inclusion/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# Define the UI
44
app_ui = ui.page_fluid(
5-
ui.include_css("./www/style.css"), # Reference the external CSS file
6-
ui.include_js("./www/customjs.js"),
5+
ui.include_css("./css/style.css", method="link_files"),
6+
ui.include_js("./js/customjs.js", method="link_files"),
77
ui.h1("Simple Shiny App with External CSS"),
88
ui.div(
99
ui.p("This is a simple Shiny app that demonstrates ui.include_css()"),
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background-color: #c8e1f7;
3+
}

tests/playwright/shiny/bugs/2061-css-js-inclusion/www/style.css renamed to tests/playwright/shiny/bugs/2061-css-js-inclusion/css/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
@import url("more.css");
12

23
body {
3-
background-color: #f0f8ff;
44
font-family: Arial, sans-serif;
55
}
66

77
h1 {
8-
color: #4682b4;
8+
color: black;
99
border-bottom: 2px solid #4682b4;
1010
padding-bottom: 10px;
1111
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const newParagraph = document.createElement('p');
2+
newParagraph.textContent = 'Heyo!';
3+
const bodyElement = document.body;
4+
bodyElement.appendChild(newParagraph);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from playwright.sync_api import Page, expect
2+
3+
from shiny.run import ShinyAppProc
4+
5+
6+
def test_inclusion(page: Page, local_app: ShinyAppProc) -> None:
7+
page.goto(local_app.url)
8+
9+
expect(page.locator("body > p")).to_have_text("Heyo!")

tests/playwright/shiny/bugs/2061-css-js-inclusion/www/customjs.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)