~openerp-community/openerp-web/qoqenator_lp816835

« back to all changes in this revision

Viewing changes to addons/base/static/test/list.js

  • Committer: Fabien Meghazi
  • Date: 2011-07-27 08:03:19 UTC
  • Revision ID: fme@openerp.com-20110727080319-nztgq4txu2tt6odq
[REM] Removed reference to view_manager.flags from views. The action flags are merged in View's options constructor argument so we shall not fetch them from view_manager anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
        }
19
19
    }};
20
20
 
21
 
    var fuck_that_shit = {
22
 
        action: {
23
 
            flags: {}
24
 
        },
25
 
        sidebar: {
26
 
            set_toolbar: function () {}
27
 
        }
28
 
    };
29
 
 
30
21
    var openerp;
31
22
    module("ListView", {
32
23
        setup: function () {
42
33
 
43
34
    test('render selection checkboxes', 2, function () {
44
35
        var listview = new openerp.base.ListView(
45
 
                fuck_that_shit, null,
46
 
                'qunit-fixture', {model: null, ids: [null, null, null], index: 0});
 
36
                null, 'qunit-fixture', {model: null, ids: [null, null, null], index: 0});
47
37
 
48
38
        listview.on_loaded(fvg);
49
39
 
60
50
    });
61
51
    test('render no checkbox if selectable=false', 1, function () {
62
52
        var listview = new openerp.base.ListView(
63
 
                fuck_that_shit, null,
64
 
                'qunit-fixture', {model: null, ids: [null, null, null], index: 0}, false,
 
53
                null, 'qunit-fixture', {model: null, ids: [null, null, null], index: 0}, false,
65
54
                {selectable: false});
66
55
 
67
56
        listview.on_loaded(fvg);
75
64
    });
76
65
    test('select a bunch of records', 2, function () {
77
66
        var listview = new openerp.base.ListView(
78
 
                fuck_that_shit, null, 'qunit-fixture',
79
 
                {model: null, ids: [1, 2, 3], index: 0});
 
67
                null, 'qunit-fixture', {model: null, ids: [1, 2, 3], index: 0});
80
68
        listview.on_loaded(fvg);
81
69
 
82
70
        listview.do_fill_table({records: [
94
82
    });
95
83
    test('render deletion button if list is deletable', 1, function () {
96
84
        var listview = new openerp.base.ListView(
97
 
                fuck_that_shit, null, 'qunit-fixture',
98
 
                {model: null, ids: [null, null, null], index: 0});
 
85
                null, 'qunit-fixture', {model: null, ids: [null, null, null], index: 0});
99
86
 
100
87
        listview.on_loaded(fvg);
101
88
 
112
99
              2, function () {
113
100
        var deleted;
114
101
        var listview = new openerp.base.ListView(
115
 
                fuck_that_shit, null, 'qunit-fixture',
 
102
                null, 'qunit-fixture',
116
103
                {model: null, unlink: function (ids) {
117
104
            deleted = ids;
118
105
        }, ids: [1, 2, 3], index: 0});
132
119
    test('multiple records deletion', 1, function () {
133
120
        var deleted;
134
121
        var listview = new openerp.base.ListView(
135
 
                fuck_that_shit, null, 'qunit-fixture',
 
122
                null, 'qunit-fixture',
136
123
                {model: null, unlink: function (ids) {
137
124
            deleted = ids;
138
125
        }, ids: [1, 2, 3], index: 0});