Skip to content

Commit

Permalink
Removing more dash namespace references
Browse files Browse the repository at this point in the history
  • Loading branch information
HammadTheOne committed Oct 8, 2021
1 parent 0ad3b24 commit 3aa7abd
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/testthat/test-attributes.R
Expand Up @@ -92,32 +92,32 @@ test_that("stylesheets can be added with or without attributes", {
# construct the script tags as they should be generated within
# Dash for R this way the mod times and version numbers will
# always be in sync with those used by the backend
internal_hrefs <- vapply(dash:::.dash_js_metadata(), function(x) x$src$href, character(1))
internal_hrefs <- vapply(.dash_js_metadata(), function(x) x$src$href, character(1))

dcc <- dash:::.dashCoreComponents_js_metadata()
dhc <- dash:::.dashHtmlComponents_js_metadata()
dt <- dash:::.dashTable_js_metadata()
dcc <- .dashCoreComponents_js_metadata()
dhc <- .dashHtmlComponents_js_metadata()
dt <- .dashTable_js_metadata()

dcc_min <- dcc[which(sapply(dcc, "[[", "script") == "dcc/dash_core_components.js")][[1]]
dcc_shared <- dcc[which(sapply(dcc, "[[", "script") == "dcc/dash_core_components-shared.js")][[1]]
dhc_min <- dhc[which(sapply(dhc, "[[", "script") == "html/dash_html_components.min.js")][[1]]
dt_bundle <- dt[which(sapply(dt, "[[", "script") == "dash_table/bundle.js")][[1]]

dcc_min_path <- dash:::getDependencyPath(dcc_min)
dcc_min_path <- getDependencyPath(dcc_min)
dcc_min_modtime <- as.integer(file.mtime(dcc_min_path))
dcc_min_filename <- basename(dash:::buildFingerprint(dcc_min$script, dcc_min$version, dcc_min_modtime))
dcc_min_filename <- basename(buildFingerprint(dcc_min$script, dcc_min$version, dcc_min_modtime))

dcc_shared_path <- dash:::getDependencyPath(dcc_shared)
dcc_shared_path <- getDependencyPath(dcc_shared)
dcc_shared_modtime <- as.integer(file.mtime(dcc_shared_path))
dcc_shared_filename <- basename(dash:::buildFingerprint(dcc_shared$script, dcc_shared$version, dcc_shared_modtime))
dcc_shared_filename <- basename(buildFingerprint(dcc_shared$script, dcc_shared$version, dcc_shared_modtime))

dhc_min_path <- dash:::getDependencyPath(dhc_min)
dhc_min_path <- getDependencyPath(dhc_min)
dhc_min_modtime <- as.integer(file.mtime(dhc_min_path))
dhc_min_filename <- basename(dash:::buildFingerprint(dhc_min$script, dhc_min$version, dhc_min_modtime))
dhc_min_filename <- basename(buildFingerprint(dhc_min$script, dhc_min$version, dhc_min_modtime))

dt_bundle_path <- dash:::getDependencyPath(dt_bundle)
dt_bundle_path <- getDependencyPath(dt_bundle)
dt_bundle_modtime <- as.integer(file.mtime(dt_bundle_path))
dt_bundle_filename <- basename(dash:::buildFingerprint(dt_bundle$script, dt_bundle$version, dt_bundle_modtime))
dt_bundle_filename <- basename(buildFingerprint(dt_bundle$script, dt_bundle$version, dt_bundle_modtime))

dcc_min_ref <- paste0("/",
"_dash-component-suites/",
Expand Down Expand Up @@ -202,7 +202,7 @@ test_that("invalid attributes trigger an error", {
)
)

expect_error(dash:::assertValidExternals(external_scripts, external_stylesheets),
expect_error(assertValidExternals(external_scripts, external_stylesheets),
"The following script or stylesheet attributes are invalid: baz, foo, bar.")
})

Expand All @@ -217,7 +217,7 @@ test_that("not passing named attributes triggers an error", {

external_scripts <- list()

expect_error(dash:::assertValidExternals(external_scripts, external_stylesheets),
expect_error(assertValidExternals(external_scripts, external_stylesheets),
"Please verify that all attributes are named elements when specifying URLs for scripts and stylesheets.")
})

Expand Down

0 comments on commit 3aa7abd

Please sign in to comment.