Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cto
g1
Commits
8230089c
Commit
8230089c
authored
Feb 27, 2019
by
Tejesh
🖖
Browse files
TST: add more tests, add lint check in pretest command
parent
6286a2d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
package.json
View file @
8230089c
...
...
@@ -13,7 +13,7 @@
"lint"
:
"eslint index*.js src && eclint check '**/*.html' '**/*.js' '**/*.css' '**/*.yaml' '**/*.md'"
,
"build"
:
"rimraf dist && json2module package.json > src/package.js && rollup -c"
,
"dev"
:
"rimraf dist && json2module package.json > src/package.js && rollup -c -w"
,
"pretest"
:
"npm run build && browserify -s tape -r tape -o test/tape.js"
,
"pretest"
:
"npm run
lint && npm run
build && browserify -s tape -r tape -o test/tape.js"
,
"server"
:
"npm run pretest && npm run lint && node test/server.js"
,
"test"
:
"tape test/test-*.js | faucet && node test/server.js puppeteer | tap-merge | faucet"
,
"test-chrome"
:
"node test/server.js chrome | tap-merge | faucet"
,
...
...
test/test-formhandler-editable.html
View file @
8230089c
...
...
@@ -148,6 +148,8 @@
test
.
equals
(
$
(
"
.edit-fh table > tbody > tr:nth-child(1) > td:nth-child(2) > input
"
).
val
().
trim
(),
init_cell_value
)
$
(
"
.edit-fh table > tbody > tr:nth-child(1) > td:nth-child(3) > input
"
).
val
(
'
300000
'
).
trigger
(
'
change
'
)
$
(
"
.edit-fh table > tbody > tr:nth-child(3) > td:nth-child(3) > input
"
).
val
(
'
-90
'
).
trigger
(
'
change
'
)
// save row
$
(
'
.edit button
'
).
click
()
...
...
@@ -161,11 +163,29 @@
// // save row
$
(
'
.edit button
'
).
click
()
$
(
'
.add button
'
).
click
()
test
.
equals
(
$
(
'
div.edit-fh tr.new-row td:nth-child(4) select
'
).
length
,
1
)
// all other columns must be input textbox and editable, overriding isEditable: false option also
test
.
equals
(
$
(
'
div.edit-fh tr.new-row td:nth-child(1) input
'
).
length
,
1
)
test
.
end
()
test
.
equals
(
$
(
'
.is-invalid
'
).
val
(),
'
-90
'
)
$
(
"
.edit-fh table > tbody > tr:nth-child(3) > td:nth-child(3) > input
"
).
val
(
'
28
'
).
trigger
(
'
change
'
)
$
(
'
.edit button
'
).
click
()
setTimeout
(
function
()
{
// COMMENTING NEXT TEST CASE: Gramex required
// test.notOk($('.add button').prop('disabled'))
// test.equals($('.edit-btn').text(), 'Edit')
$
(
'
.add button
'
).
click
()
test
.
ok
(
$
(
'
.edit button
'
).
prop
(
'
disabled
'
))
test
.
equals
(
$
(
'
div.edit-fh tr.new-row td:nth-child(4) select
'
).
length
,
1
)
// all other columns must be input textbox and editable, overriding isEditable: false option also
test
.
equals
(
$
(
'
div.edit-fh tr.new-row td:nth-child(1) input
'
).
length
,
1
)
test
.
ok
(
$
(
'
.edit button
'
).
prop
(
'
disabled
'
))
test
.
end
()
},
500
)
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment