|
1 | 1 | test_that("display works", { |
2 | 2 | res <- display( |
3 | | - system.file( |
4 | | - "examples/Email_Voting.bpmn", |
5 | | - package = "bpmnVisualizationR" |
6 | | - ) |
7 | | - ) |
8 | | - expect_true( |
9 | | - inherits( |
10 | | - res, |
11 | | - "bpmnVisualizationR" |
12 | | - ) |
| 3 | + system.file("examples/Email_Voting.bpmn", package = "bpmnVisualizationR") |
13 | 4 | ) |
14 | | - expect_true( |
15 | | - inherits( |
16 | | - res, |
17 | | - "htmlwidget" |
18 | | - ) |
19 | | - ) |
20 | | - |
| 5 | + |
| 6 | + expect_true(inherits(res, "bpmnVisualizationR")) |
| 7 | + expect_true(inherits(res, "htmlwidget")) |
| 8 | + |
21 | 9 | # Be sure that the xml is in the widget |
22 | 10 | string <- paste( |
23 | 11 | readLines( |
24 | | - system.file( |
25 | | - "examples/Email_Voting.bpmn", |
26 | | - package = "bpmnVisualizationR" |
27 | | - ) |
| 12 | + system.file("examples/Email_Voting.bpmn", package = "bpmnVisualizationR") |
28 | 13 | ), |
29 | 14 | collapse = " " |
30 | 15 | ) |
31 | | - |
32 | | - expect_true( |
33 | | - grepl( |
34 | | - substr(string, 1000, 1010), |
35 | | - res$x$bpmnContent |
36 | | - ) |
37 | | - ) |
38 | | - |
39 | | - expect_true( |
40 | | - grepl( |
41 | | - substr(string, 2000, 2010), |
42 | | - res$x$bpmnContent |
43 | | - ) |
44 | | - ) |
| 16 | + |
| 17 | + expect_true(grepl(substr(string, 1000, 1010), res$x$bpmnContent)) |
| 18 | + expect_true(grepl(substr(string, 2000, 2010), res$x$bpmnContent)) |
45 | 19 | }) |
46 | 20 |
|
47 | 21 | test_that("bpmnVisualizationROutput works", { |
48 | 22 | res <- bpmnVisualizationROutput("xyz") |
49 | | - expect_true( |
50 | | - inherits( |
51 | | - res, |
52 | | - "shiny.tag.list" |
53 | | - ) |
54 | | - ) |
55 | | - |
56 | | - expect_true( |
57 | | - grepl( |
58 | | - "bpmnVisualizationR", |
59 | | - res |
60 | | - ) |
61 | | - ) |
| 23 | + |
| 24 | + expect_true(inherits(res, "shiny.tag.list")) |
| 25 | + expect_true(grepl("bpmnVisualizationR", res)) |
62 | 26 | }) |
63 | 27 |
|
64 | 28 |
|
65 | 29 | test_that("renderBpmnVisualizationR works", { |
66 | 30 | skip_if_not_installed("shiny") |
| 31 | + |
67 | 32 | res <- renderBpmnVisualizationR({ |
68 | 33 | display( |
69 | | - system.file( |
70 | | - "examples/Email_Voting.bpmn", |
71 | | - package = "bpmnVisualizationR" |
72 | | - ) |
| 34 | + system.file("examples/Email_Voting.bpmn", package = "bpmnVisualizationR") |
73 | 35 | ) |
74 | 36 | }) |
75 | | - expect_true( |
76 | | - inherits( |
77 | | - res, |
78 | | - "shiny.render.function" |
79 | | - ) |
80 | | - ) |
81 | | - expect_true( |
82 | | - inherits( |
83 | | - res(), |
84 | | - "json" |
85 | | - ) |
86 | | - ) |
| 37 | + |
| 38 | + expect_true(inherits(res, "shiny.render.function")) |
| 39 | + expect_true(inherits(res(), "json")) |
87 | 40 | }) |
0 commit comments