Commit 8230089c authored by Tejesh's avatar Tejesh 🖖
Browse files

TST: add more tests, add lint check in pretest command

parent 6286a2d3
......@@ -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",
......
......@@ -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)
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment