Skip to content

Commit

Permalink
add e2e test from vscode ...
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Sep 19, 2024
1 parent a3f8b15 commit ca37355
Show file tree
Hide file tree
Showing 10 changed files with 453 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"makefile.configureOnOpen": false
}
6 changes: 4 additions & 2 deletions inst/examples/restore-workspace/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ library(blockr)

set_workspace(
stack_1 = new_stack(
# Won't autoclick on submit
block_11 = new_dataset_block("anscombe"),
block_12 = new_select_block(c("x1", "y1"))
block_12 = new_filter_block("x1", 10, ">")
),
# Submit autoclick
stack_2 = new_stack(
block_21 = new_dataset_block("anscombe"),
block_22 = new_select_block(c("x2", "y2"))
block_22 = new_filter_block("x1", 10, ">", submit = TRUE)
)
)

Expand Down
Binary file modified tests/testthat/_snaps/block/block-app-001_.new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/testthat/_snaps/block/block-app-003_.new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/testthat/_snaps/block/block-app-004_.new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
181 changes: 181 additions & 0 deletions tests/testthat/_snaps/block/block-autosubmit-app-001.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
{
"input": {
"my_stack-block_2-submit": 0
},
"output": {
"my_stack-block_2-res": {
"x": {
"style": "bootstrap5",
"filter": "none",
"vertical": false,
"container": "<table class=\"table table-striped table-hover row-border order-column display\">\n <thead>\n <tr>\n <th> <\/th>\n <th>x1<\/th>\n <th>x2<\/th>\n <th>x3<\/th>\n <th>x4<\/th>\n <th>y1<\/th>\n <th>y2<\/th>\n <th>y3<\/th>\n <th>y4<\/th>\n <\/tr>\n <\/thead>\n<\/table>",
"options": {
"pageLength": 5,
"processing": false,
"columnDefs": [
{
"className": "dt-right",
"targets": [
1,
2,
3,
4,
5,
6,
7,
8
]
},
{
"orderable": false,
"targets": 0
},
{
"name": " ",
"targets": 0
},
{
"name": "x1",
"targets": 1
},
{
"name": "x2",
"targets": 2
},
{
"name": "x3",
"targets": 3
},
{
"name": "x4",
"targets": 4
},
{
"name": "y1",
"targets": 5
},
{
"name": "y2",
"targets": 6
},
{
"name": "y3",
"targets": 7
},
{
"name": "y4",
"targets": 8
}
],
"order": [

],
"autoWidth": false,
"orderClasses": false,
"lengthMenu": [
5,
10,
25,
50,
100
],
"ajax": {
"type": "POST",
"data": "function(d) {\nd.search.caseInsensitive = true;\nd.search.smart = true;\nd.escape = true;\nvar encodeAmp = function(x) { x.value = x.value.replace(/&/g, \"%26\"); }\nencodeAmp(d.search);\n$.each(d.columns, function(i, v) {encodeAmp(v.search);});\n}"
},
"serverSide": true
},
"selection": {
"mode": "none",
"selected": null,
"target": "row",
"selectable": null
}
},
"evals": [
"options.ajax.data"
],
"jsHooks": [

],
"deps": [
{
"name": "jquery",
"version": "3.6.0",
"src": {
"href": "jquery-3.6.0"
},
"meta": null,
"script": "jquery-3.6.0.min.js",
"stylesheet": null,
"head": null,
"attachment": null,
"all_files": true
},
{
"name": "dt-core-bootstrap5",
"version": "1.13.6",
"src": {
"href": "dt-core-bootstrap5-1.13.6"
},
"meta": null,
"script": [
"js/jquery.dataTables.min.js",
"js/dataTables.bootstrap5.min.js"
],
"stylesheet": "css/dataTables.bootstrap5.min.css",
"head": null,
"attachment": null,
"package": null,
"all_files": false
},
{
"name": "bootstrap",
"version": "5.3.1",
"src": {
"href": "bootstrap-5.3.1"
},
"meta": {
"viewport": "width=device-width, initial-scale=1, shrink-to-fit=no"
},
"script": "bootstrap.bundle.min.js",
"stylesheet": "bootstrap.min.css",
"head": null,
"attachment": null,
"package": null,
"all_files": true
},
{
"name": "bs3compat",
"version": "0.8.0",
"src": {
"href": "bs3compat-0.8.0"
},
"meta": null,
"script": [
"transition.js",
"tabs.js",
"bs3compat.js"
],
"stylesheet": null,
"head": null,
"attachment": null,
"all_files": true
},
{
"name": "crosstalk",
"version": "1.2.1",
"src": {
"href": "crosstalk-1.2.1"
},
"meta": null,
"script": "js/crosstalk.min.js",
"stylesheet": "css/crosstalk.min.css",
"head": null,
"attachment": null,
"all_files": true
}
]
}
}
}
12 changes: 12 additions & 0 deletions tests/testthat/_snaps/block/block-submit-app-001.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"input": {
"my_stack-block_2-submit": 0
},
"output": {
"my_stack-block_2-res": [
"",
"NULL",
"c(\"shiny.silent.error\", \"validation\")"
]
}
}
181 changes: 181 additions & 0 deletions tests/testthat/_snaps/block/block-submit-app-002.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
{
"input": {
"my_stack-block_2-submit": 1
},
"output": {
"my_stack-block_2-res": {
"x": {
"style": "bootstrap5",
"filter": "none",
"vertical": false,
"container": "<table class=\"table table-striped table-hover row-border order-column display\">\n <thead>\n <tr>\n <th> <\/th>\n <th>x1<\/th>\n <th>x2<\/th>\n <th>x3<\/th>\n <th>x4<\/th>\n <th>y1<\/th>\n <th>y2<\/th>\n <th>y3<\/th>\n <th>y4<\/th>\n <\/tr>\n <\/thead>\n<\/table>",
"options": {
"pageLength": 5,
"processing": false,
"columnDefs": [
{
"className": "dt-right",
"targets": [
1,
2,
3,
4,
5,
6,
7,
8
]
},
{
"orderable": false,
"targets": 0
},
{
"name": " ",
"targets": 0
},
{
"name": "x1",
"targets": 1
},
{
"name": "x2",
"targets": 2
},
{
"name": "x3",
"targets": 3
},
{
"name": "x4",
"targets": 4
},
{
"name": "y1",
"targets": 5
},
{
"name": "y2",
"targets": 6
},
{
"name": "y3",
"targets": 7
},
{
"name": "y4",
"targets": 8
}
],
"order": [

],
"autoWidth": false,
"orderClasses": false,
"lengthMenu": [
5,
10,
25,
50,
100
],
"ajax": {
"type": "POST",
"data": "function(d) {\nd.search.caseInsensitive = true;\nd.search.smart = true;\nd.escape = true;\nvar encodeAmp = function(x) { x.value = x.value.replace(/&/g, \"%26\"); }\nencodeAmp(d.search);\n$.each(d.columns, function(i, v) {encodeAmp(v.search);});\n}"
},
"serverSide": true
},
"selection": {
"mode": "none",
"selected": null,
"target": "row",
"selectable": null
}
},
"evals": [
"options.ajax.data"
],
"jsHooks": [

],
"deps": [
{
"name": "jquery",
"version": "3.6.0",
"src": {
"href": "jquery-3.6.0"
},
"meta": null,
"script": "jquery-3.6.0.min.js",
"stylesheet": null,
"head": null,
"attachment": null,
"all_files": true
},
{
"name": "dt-core-bootstrap5",
"version": "1.13.6",
"src": {
"href": "dt-core-bootstrap5-1.13.6"
},
"meta": null,
"script": [
"js/jquery.dataTables.min.js",
"js/dataTables.bootstrap5.min.js"
],
"stylesheet": "css/dataTables.bootstrap5.min.css",
"head": null,
"attachment": null,
"package": null,
"all_files": false
},
{
"name": "bootstrap",
"version": "5.3.1",
"src": {
"href": "bootstrap-5.3.1"
},
"meta": {
"viewport": "width=device-width, initial-scale=1, shrink-to-fit=no"
},
"script": "bootstrap.bundle.min.js",
"stylesheet": "bootstrap.min.css",
"head": null,
"attachment": null,
"package": null,
"all_files": true
},
{
"name": "bs3compat",
"version": "0.8.0",
"src": {
"href": "bs3compat-0.8.0"
},
"meta": null,
"script": [
"transition.js",
"tabs.js",
"bs3compat.js"
],
"stylesheet": null,
"head": null,
"attachment": null,
"all_files": true
},
{
"name": "crosstalk",
"version": "1.2.1",
"src": {
"href": "crosstalk-1.2.1"
},
"meta": null,
"script": "js/crosstalk.min.js",
"stylesheet": "css/crosstalk.min.css",
"head": null,
"attachment": null,
"all_files": true
}
]
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ca37355

Please sign in to comment.