diff --git a/tests/testthat/test-nodes.R b/tests/testthat/test-nodes.R index a6654cf..3527eed 100644 --- a/tests/testthat/test-nodes.R +++ b/tests/testthat/test-nodes.R @@ -151,19 +151,19 @@ test_that("We cannot make nonsensical NodeLists", { test_that("toJSON methods for nodes work", { nodeA <- Node('A') - expect_equal(veupathUtils::toJSON(nodeA), '{"id":"A","degree":0}') - expect_equal(veupathUtils::toJSON(nodeA, named = TRUE), '{"node":{"id":"A","degree":0}}') + expect_equal(veupathUtils::toJSON(nodeA), '{"id":"A"}') + expect_equal(veupathUtils::toJSON(nodeA, named = TRUE), '{"node":{"id":"A"}}') # w weights and colors nodeB <- Node('B', color = 'red', weight = 10) - expect_equal(veupathUtils::toJSON(nodeB), '{"id":"B","color":"red","weight":10,"degree":0}') - expect_equal(veupathUtils::toJSON(nodeB, named = TRUE), '{"node":{"id":"B","color":"red","weight":10,"degree":0}}') + expect_equal(veupathUtils::toJSON(nodeB), '{"id":"B","color":"red","weight":10}') + expect_equal(veupathUtils::toJSON(nodeB, named = TRUE), '{"node":{"id":"B","color":"red","weight":10}}') #NodeList nodeA <- Node('A', color='blue', weight=5) nodeList <- NodeList(list(nodeA, nodeB)) - expect_equal(veupathUtils::toJSON(nodeList), '{"nodes":[{"id":"A","color":"blue","weight":5,"degree":0},{"id":"B","color":"red","weight":10,"degree":0}]}') - expect_equal(veupathUtils::toJSON(nodeList, named = FALSE), '[{"id":"A","color":"blue","weight":5,"degree":0},{"id":"B","color":"red","weight":10,"degree":0}]') + expect_equal(veupathUtils::toJSON(nodeList), '{"nodes":[{"id":"A","color":"blue","weight":5},{"id":"B","color":"red","weight":10}]}') + expect_equal(veupathUtils::toJSON(nodeList, named = FALSE), '[{"id":"A","color":"blue","weight":5},{"id":"B","color":"red","weight":10}]') #NodeIdList nodeIdList <- NodeIdList(list(NodeId('A'), NodeId('B'))) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 724f755..10ddc03 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -4,7 +4,7 @@ test_that("numBinsToBinWidth() returns a binWidth that will actually provide the binWidth <- numBinsToBinWidth(testDF$entity.int6, 8) viewport <- findViewport(testDF$entity.int6, 'NUMBER') x <- bin(testDF$entity.int6, binWidth, viewport) - expect_equal(data.table::uniqueN(x),5) + expect_equal(data.table::uniqueN(x),6) binWidth <- numBinsToBinWidth(testDF$entity.int6, 1) viewport <- findViewport(testDF$entity.int6, 'NUMBER')