-
-
Notifications
You must be signed in to change notification settings - Fork 31
Support for meta tags in Dash for R #142
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
10ae196
:sparkles: initial support for meta tags
f0f7b15
:hammer: fix tags
bb897d3
:see_no_evil: properly detect paths
253e8be
support arbitrary tags
67fb44a
:rotating_light: add tests
3e77327
:microscope: add asserts
1624eef
add reference to meta tag PR
rpkyle d459cbe
:fast_forward: indent meta tags
d9c419a
Merge branch '141-meta-tags' of github.com:plotly/dashR into 141-meta…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
from selenium.webdriver.support.select import Select | ||
import time, os | ||
|
||
|
||
app = """ | ||
library(dash) | ||
library(dashHtmlComponents) | ||
|
||
app <- Dash$new(meta_tags = list(list(name = "description", content = "some content"))) | ||
|
||
app$layout( | ||
htmlDiv(children = "Hello world!", | ||
id = "hello-div" | ||
) | ||
) | ||
|
||
app$run_server() | ||
""" | ||
|
||
|
||
def test_rstm001_test_meta(dashr): | ||
dashr.start_server(app) | ||
dashr.wait_for_text_to_equal( | ||
"#hello-div", | ||
"Hello world!" | ||
) | ||
assert dashr.find_element("meta[name='description']").get_attribute("content") == "some content" | ||
assert dashr.find_element("meta[charset='UTF-8']") | ||
assert dashr.find_element("meta[http-equiv='X-UA-Compatible']").get_attribute("content") == "IE=edge" | ||
|
||
|
||
app2 = """ | ||
library(dash) | ||
library(dashHtmlComponents) | ||
|
||
app <- Dash$new(meta_tags = list(list(charset = "ISO-8859-1"), | ||
list(name = "keywords", content = "dash,pleasant,productive"), | ||
list(`http-equiv` = 'content-type', content = 'text/html'))) | ||
|
||
app$layout( | ||
htmlDiv(children = "Hello world!", | ||
id = "hello-div" | ||
) | ||
) | ||
|
||
app$run_server() | ||
""" | ||
|
||
|
||
def test_rstm002_test_meta(dashr): | ||
dashr.start_server(app2) | ||
dashr.wait_for_text_to_equal( | ||
"#hello-div", | ||
"Hello world!" | ||
) | ||
assert dashr.find_element("meta[charset='ISO-8859-1']") | ||
assert dashr.find_element("meta[name='keywords']").get_attribute("content") == "dash,pleasant,productive" | ||
assert dashr.find_element("meta[http-equiv='content-type']").get_attribute("content") == "text/html" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.