tests/testthat/test-get_figma_file_content.R

# WARNING - Generated by {fusen} from /dev/flat_figma_api_connection.Rmd: do not edit by hand

test_that("get_figma_file_content works", {

  # No error
  expect_error(file_content <- get_figma_file_content(file_key = "wRqIvMmymzSPuj0sEhnORb",
                                                    acess_token = Sys.getenv("FIGMA_TOKEN")), 
               regexp = NA)
  
  expect_error(file_content <- get_figma_file_content(file_key = "wRqIvMmymzSPuj0sEhnORb"), 
               regexp = NA)
  
  expect_equal(length(file_content), 
               12)
  
  # Error
  expect_error(file_content <- get_figma_file_content(acess_token = ""))
  
  expect_error(file_content <- get_figma_file_content(file_key = ""))
  
  expect_error(file_content <- get_figma_file_content(file_key = "", 
                                                    acess_token = ""))
  
})
ThinkR-open/swatch documentation built on April 7, 2022, 6:08 p.m.