summaryrefslogtreecommitdiff
path: root/addons/barcodes/static/tests
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-08-25 14:29:11 +0200
committerAaron Bohy <aab@odoo.com>2017-08-25 15:54:56 +0200
commit802dde31f3b58b8f26d6f6c584e5e4f8f392a482 (patch)
tree6aab2151a71e402ebde791559f30f020b3e8bcb4 /addons/barcodes/static/tests
parent8019eacb4716befcc0affa4f8c9d554be2ec6655 (diff)
[FIX] web,barcodes: pager: FIRST and LAST actions
The barcode mechanism is supposed to handle commands PAGER-FIRST (go to first record referenced in the pager) and PAGER-LAST (go to last record). Before this rev., it wasn't the case. We needed to add an option 'notifyChange' to the updateState function of the pager, to ensure that the form is correctly reloaded when the pager cursor is manually set (by the barcode handler) on the first or last element.
Diffstat (limited to 'addons/barcodes/static/tests')
-rw-r--r--addons/barcodes/static/tests/barcode_tests.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/addons/barcodes/static/tests/barcode_tests.js b/addons/barcodes/static/tests/barcode_tests.js
index 5f8af60911b..add55ed4d5d 100644
--- a/addons/barcodes/static/tests/barcode_tests.js
+++ b/addons/barcodes/static/tests/barcode_tests.js
@@ -128,7 +128,7 @@ QUnit.test('edit, save and cancel buttons', function (assert) {
});
QUnit.test('pager buttons', function (assert) {
- assert.expect(3);
+ assert.expect(5);
var form = createView({
View: FormView,
@@ -149,6 +149,12 @@ QUnit.test('pager buttons', function (assert) {
// O-CMD.PAGER-PREV
_.each(["O","-","C","M","D",".","P","A","G","E","R","-","P","R","E","V","Enter"], triggerKeypressEvent);
assert.strictEqual(form.$('.o_field_widget').text(), 'iPad Mini');
+ // O-CMD.PAGER-LAST
+ _.each(["O","-","C","M","D",".","P","A","G","E","R","-","L","A","S","T","Enter"], triggerKeypressEvent);
+ assert.strictEqual(form.$('.o_field_widget').text(), 'Mouse, Optical');
+ // O-CMD.PAGER-FIRST
+ _.each(["O","-","C","M","D",".","P","A","G","E","R","-","F","I","R","S","T","Enter"], triggerKeypressEvent);
+ assert.strictEqual(form.$('.o_field_widget').text(), 'iPad Mini');
form.destroy();
});