Adding interaction tests for gantt callbacks with arguments

This commit is contained in:
Knut Sveidqvist
2020-01-01 12:03:29 -08:00
parent a1626927cc
commit 33916cfbd3
3 changed files with 44 additions and 12 deletions

View File

@@ -49,9 +49,11 @@
section Clickable
Visit mermaidjs :active, cl1, 2014-01-07,2014-01-10
Calling a Callback (look at the console log) :cl2, after cl1, 3d
Calling a Callback with args :cl3, after cl1, 3d
click cl1 href "http://localhost:9000/webpackUsage.html"
click cl2 call clickByGantt("test", test, test)
click cl2 call clickByGantt()
click cl3 call clickByGantt("test1", test2, test3)
section Last section
Describe gantt syntax :after doc1, 3d
@@ -69,11 +71,14 @@
document.getElementsByTagName('body')[0].appendChild(div)
}
function clickByGantt(elemName) {
function clickByGantt(arg1, arg2, arg3) {
const div = document.createElement('div')
div.className = 'created-by-gant-click'
div.style = 'padding: 20px; background: green; color: white;'
div.innerText = 'Clicked By Gant'
if (arg1) div.innerText += ' ' + arg1;
if (arg2) div.innerText += ' ' + arg2;
if (arg3) div.innerText += ' ' + arg3;
document.getElementsByTagName('body')[0].appendChild(div)
}