Skip to content

Commit

Permalink
Further fixes to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
akbertram committed Nov 6, 2023
1 parent 4aaa556 commit 6260d2c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 70 deletions.
57 changes: 0 additions & 57 deletions tests/testthat/_snaps/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,63 +67,6 @@
thirdPartyTranslation = FALSE, translationFromDbMemory = FALSE,
userId = "<id value>", version = "3"), class = "databaseTree")

---

structure(list(billingAccountId = "<id value>", continuousTranslation = FALSE,
databaseId = "<id value>", description = "", grants = list(),
label = "My first database", language = "", languages = list(),
locks = list(), originalLanguage = "", ownerRef = list(email = "<id value>",
id = "<id value>", name = "Bob"), publishedTemplate = FALSE,
resources = list("Empty resources until we can ensure a sort order in the API."),
role = list(id = "<id value>", parameters = list(), resources = list()),
roles = list(list(filters = list(), grantBased = TRUE, grants = list(
list(operations = list(list(filter = NULL, operation = "VIEW",
securityCategories = list()), list(filter = NULL,
operation = "DISCOVER", securityCategories = list()),
list(filter = NULL, operation = "EDIT_RECORD", securityCategories = list()),
list(filter = NULL, operation = "ADD_RECORD", securityCategories = list()),
list(filter = NULL, operation = "DELETE_RECORD",
securityCategories = list()), list(filter = NULL,
operation = "EXPORT_RECORDS", securityCategories = list())),
optional = FALSE, resourceId = "<id value>")), id = "<id value>",
label = "Data Entry", parameters = list(), permissions = list(),
version = 0L), list(filters = list(), grantBased = TRUE,
grants = list(list(operations = list(list(filter = NULL,
operation = "VIEW", securityCategories = list()),
list(filter = NULL, operation = "DISCOVER", securityCategories = list())),
optional = FALSE, resourceId = "<id value>")), id = "<id value>",
label = "Read only", parameters = list(), permissions = list(),
version = 0L), list(filters = list(), grantBased = TRUE,
grants = list(list(operations = list(list(filter = NULL,
operation = "VIEW", securityCategories = list()),
list(filter = NULL, operation = "DISCOVER", securityCategories = list()),
list(filter = NULL, operation = "ADD_RECORD", securityCategories = list()),
list(filter = NULL, operation = "EDIT_RECORD", securityCategories = "reviewer"),
list(filter = NULL, operation = "DELETE_RECORD",
securityCategories = list()), list(filter = NULL,
operation = "BULK_DELETE", securityCategories = list()),
list(filter = NULL, operation = "EXPORT_RECORDS",
securityCategories = list()), list(filter = NULL,
operation = "LOCK_RECORDS", securityCategories = list()),
list(filter = NULL, operation = "ADD_RESOURCE", securityCategories = list()),
list(filter = NULL, operation = "EDIT_RESOURCE",
securityCategories = list()), list(filter = NULL,
operation = "DELETE_RESOURCE", securityCategories = list()),
list(filter = NULL, operation = "MANAGE_COLLECTION_LINKS",
securityCategories = list()), list(filter = NULL,
operation = "AUDIT", securityCategories = list()),
list(filter = NULL, operation = "PUBLISH_REPORTS",
securityCategories = list()), list(filter = NULL,
operation = "MANAGE_TRANSLATIONS", securityCategories = list())),
optional = FALSE, resourceId = "<id value>")), id = "<id value>",
label = "Administrator", parameters = list(), permissions = list(
list(filter = NULL, operation = "MANAGE_USERS", securityCategories = list()),
list(filter = NULL, operation = "MANAGE_ROLES", securityCategories = list())),
version = 0L)), securityCategories = list(list(id = "<id value>",
label = "Reviewer only")), storage = "", suspended = FALSE,
thirdPartyTranslation = FALSE, translationFromDbMemory = FALSE,
userId = "<id value>", version = "3"), class = "databaseTree")

# getDatabaseResources() works

Code
Expand Down
14 changes: 1 addition & 13 deletions tests/testthat/test-databases.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,7 @@ testthat::test_that("getDatabaseTree() works", {
testthat::expect_s3_class(tree, "databaseTree")
testthat::expect_named(tree, c("databaseId", "userId", "version", "label", "description", "ownerRef", "billingAccountId", "language", "originalLanguage", "continuousTranslation", "translationFromDbMemory", "thirdPartyTranslation", "languages", "role", "suspended", "storage", "publishedTemplate", "resources", "grants", "locks", "roles", "securityCategories"))
testthat::expect_identical(tree$databaseId, database$databaseId)
if(tree$roles[[1]]$grantBased){
expectActivityInfoSnapshot(tree)
testthat::expect_error({
expectActivityInfoSnapshot(tree)
})
}else{
testthat::expect_error({
expectActivityInfoSnapshot(tree)
})
expectActivityInfoSnapshot(tree)
}


expectActivityInfoSnapshot(tree)
})

testthat::test_that("getDatabaseResources() works", {
Expand Down

0 comments on commit 6260d2c

Please sign in to comment.