[FIX] web: prevent test interference
In the view dialog test suite, a few tests created a parent widget, then
created a view dialog, and destroyed the view dialog at the end, but not
the parent widget. As a result, the environment was not properly
restored at the end.
In this case, the test 'SelectCreateDialog correctly evaluates domains'
changed the session (with user_context: {uid: 2}), and this made other
tests crash (web_editor test in particular)
This commit is contained in:
@@ -55,7 +55,7 @@ QUnit.module('Views', {
|
||||
});
|
||||
|
||||
|
||||
var dialog = new dialogs.FormViewDialog(parent, {
|
||||
new dialogs.FormViewDialog(parent, {
|
||||
res_model: 'partner',
|
||||
res_id: 1,
|
||||
}).open();
|
||||
@@ -64,7 +64,7 @@ QUnit.module('Views', {
|
||||
"should not have any button in body");
|
||||
assert.strictEqual($('div.modal .modal-footer button').length, 1,
|
||||
"should have only one button in footer");
|
||||
dialog.destroy();
|
||||
parent.destroy();
|
||||
});
|
||||
|
||||
QUnit.test('SelectCreateDialog use domain, group_by and search default', function (assert) {
|
||||
@@ -137,7 +137,7 @@ QUnit.module('Views', {
|
||||
dialog.$('.o_searchview_facet:contains(groupby_bar) .o_facet_remove').click();
|
||||
dialog.$('.o_searchview_facet .o_facet_remove').click();
|
||||
|
||||
dialog.destroy();
|
||||
parent.destroy();
|
||||
});
|
||||
|
||||
QUnit.test('SelectCreateDialog correctly evaluates domains', function (assert) {
|
||||
@@ -168,14 +168,14 @@ QUnit.module('Views', {
|
||||
},
|
||||
});
|
||||
|
||||
var dialog = new dialogs.SelectCreateDialog(parent, {
|
||||
new dialogs.SelectCreateDialog(parent, {
|
||||
no_create: true,
|
||||
readonly: true,
|
||||
res_model: 'partner',
|
||||
domain: "[['id', '=', uid]]",
|
||||
}).open();
|
||||
|
||||
dialog.destroy();
|
||||
parent.destroy();
|
||||
});
|
||||
|
||||
QUnit.test('SelectCreateDialog list view in readonly', function (assert) {
|
||||
@@ -204,7 +204,7 @@ QUnit.module('Views', {
|
||||
assert.equal(dialog.$('.o_list_view tbody tr:first td:not(.o_list_record_selector):first input').length, 0,
|
||||
"list view should not be editable in a SelectCreateDialog");
|
||||
|
||||
dialog.destroy();
|
||||
parent.destroy();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user