[FIX] unit tests for list view following change in records topology
bzr revid: xmo@openerp.com-20110412091036-w7i9dnh7svqkpa3u
This commit is contained in:
parent
5d7dae6e6f
commit
e14997c7bc
|
@ -24,7 +24,9 @@ $(document).ready(function () {
|
||||||
openerp = window.openerp.init(true);
|
openerp = window.openerp.init(true);
|
||||||
window.openerp.base.chrome(openerp);
|
window.openerp.base.chrome(openerp);
|
||||||
// views loader stuff
|
// views loader stuff
|
||||||
|
window.openerp.base.data(openerp);
|
||||||
window.openerp.base.views(openerp);
|
window.openerp.base.views(openerp);
|
||||||
|
window.openerp.base.form(openerp);
|
||||||
window.openerp.base.list(openerp);
|
window.openerp.base.list(openerp);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -36,7 +38,11 @@ $(document).ready(function () {
|
||||||
|
|
||||||
listview.on_loaded(fvg);
|
listview.on_loaded(fvg);
|
||||||
|
|
||||||
listview.do_fill_table([{}, {}, {}]).then(function () {
|
listview.do_fill_table([
|
||||||
|
{data: {id: {value: null}}},
|
||||||
|
{data: {id: {value: null}}},
|
||||||
|
{data: {id: {value: null}}}
|
||||||
|
]).then(function () {
|
||||||
ok(are(listview.$element.find('tbody th'),
|
ok(are(listview.$element.find('tbody th'),
|
||||||
'.oe-record-selector'));
|
'.oe-record-selector'));
|
||||||
ok(are(listview.$element.find('tbody th input'),
|
ok(are(listview.$element.find('tbody th input'),
|
||||||
|
@ -52,7 +58,11 @@ $(document).ready(function () {
|
||||||
|
|
||||||
listview.on_loaded(fvg);
|
listview.on_loaded(fvg);
|
||||||
|
|
||||||
listview.do_fill_table([{}, {}, {}]).then(function () {
|
listview.do_fill_table([
|
||||||
|
{data: {id: {value: null}}},
|
||||||
|
{data: {id: {value: null}}},
|
||||||
|
{data: {id: {value: null}}}
|
||||||
|
]).then(function () {
|
||||||
equal(listview.$element.find('tbody th').length, 0);
|
equal(listview.$element.find('tbody th').length, 0);
|
||||||
start();
|
start();
|
||||||
});
|
});
|
||||||
|
@ -62,7 +72,11 @@ $(document).ready(function () {
|
||||||
{}, null, 'qunit-fixture', {model: null});
|
{}, null, 'qunit-fixture', {model: null});
|
||||||
listview.on_loaded(fvg);
|
listview.on_loaded(fvg);
|
||||||
|
|
||||||
listview.do_fill_table([{id: 1}, {id: 2}, {id: 3}]).then(function () {
|
listview.do_fill_table([
|
||||||
|
{data: {id: {value: 1}}},
|
||||||
|
{data: {id: {value: 2}}},
|
||||||
|
{data: {id: {value: 3}}}
|
||||||
|
]).then(function () {
|
||||||
listview.$element.find('tbody th input:eq(2)')
|
listview.$element.find('tbody th input:eq(2)')
|
||||||
.attr('checked', true);
|
.attr('checked', true);
|
||||||
deepEqual(listview.get_selection(), [3]);
|
deepEqual(listview.get_selection(), [3]);
|
||||||
|
@ -78,7 +92,11 @@ $(document).ready(function () {
|
||||||
|
|
||||||
listview.on_loaded(fvg);
|
listview.on_loaded(fvg);
|
||||||
|
|
||||||
listview.do_fill_table([{id: 1}, {id: 2}, {id: 3}]).then(function () {
|
listview.do_fill_table([
|
||||||
|
{data: {id: {value: null}}},
|
||||||
|
{data: {id: {value: null}}},
|
||||||
|
{data: {id: {value: null}}}
|
||||||
|
]).then(function () {
|
||||||
equal(
|
equal(
|
||||||
listview.$element.find('tbody tr td.oe-record-delete button').length,
|
listview.$element.find('tbody tr td.oe-record-delete button').length,
|
||||||
3);
|
3);
|
||||||
|
@ -95,7 +113,11 @@ $(document).ready(function () {
|
||||||
|
|
||||||
listview.on_loaded(fvg);
|
listview.on_loaded(fvg);
|
||||||
|
|
||||||
listview.do_fill_table([{id: 1}, {id: 2}, {id: 3}]).then(function () {
|
listview.do_fill_table([
|
||||||
|
{data: {id: {value: 1}}},
|
||||||
|
{data: {id: {value: 2}}},
|
||||||
|
{data: {id: {value: 3}}}
|
||||||
|
]).then(function () {
|
||||||
listview.$element.find('tbody td.oe-record-delete:eq(2) button').click();
|
listview.$element.find('tbody td.oe-record-delete:eq(2) button').click();
|
||||||
deepEqual(deleted, [3]);
|
deepEqual(deleted, [3]);
|
||||||
listview.$element.find('tbody td.oe-record-delete:eq(0) button').click();
|
listview.$element.find('tbody td.oe-record-delete:eq(0) button').click();
|
||||||
|
@ -112,7 +134,11 @@ $(document).ready(function () {
|
||||||
|
|
||||||
listview.on_loaded(fvg);
|
listview.on_loaded(fvg);
|
||||||
|
|
||||||
listview.do_fill_table([{id: 1}, {id: 2}, {id: 3}]).then(function () {
|
listview.do_fill_table([
|
||||||
|
{data: {id: {value: 1}}},
|
||||||
|
{data: {id: {value: 2}}},
|
||||||
|
{data: {id: {value: 3}}}
|
||||||
|
]).then(function () {
|
||||||
listview.$element.find('tbody th input:eq(2)')
|
listview.$element.find('tbody th input:eq(2)')
|
||||||
.attr('checked', true);
|
.attr('checked', true);
|
||||||
listview.$element.find('tbody th input:eq(1)')
|
listview.$element.find('tbody th input:eq(1)')
|
||||||
|
|
Loading…
Reference in New Issue