mirror of https://github.com/OCA/web.git
[IMP] web_widget_dropdown_dynamic: black, isort, prettier
parent
b4d9c17375
commit
c99849c414
|
@ -1,6 +1,6 @@
|
||||||
odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", function (
|
odoo.define(
|
||||||
require
|
"web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests",
|
||||||
) {
|
function (require) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
/* global QUnit*/
|
/* global QUnit*/
|
||||||
|
@ -9,7 +9,9 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun
|
||||||
var testUtils = require("web.test_utils");
|
var testUtils = require("web.test_utils");
|
||||||
|
|
||||||
QUnit.module("web_widget_dropdown_dynamic", {}, function () {
|
QUnit.module("web_widget_dropdown_dynamic", {}, function () {
|
||||||
QUnit.test("values are fetched w/o context (char)", async function (assert) {
|
QUnit.test(
|
||||||
|
"values are fetched w/o context (char)",
|
||||||
|
async function (assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
|
|
||||||
var form = await testUtils.createView({
|
var form = await testUtils.createView({
|
||||||
|
@ -39,9 +41,12 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun
|
||||||
assert.containsOnce(form, "option[value='\"value\"']");
|
assert.containsOnce(form, "option[value='\"value\"']");
|
||||||
|
|
||||||
form.destroy();
|
form.destroy();
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
QUnit.test("values are fetched w/o context (integer)", async function (assert) {
|
QUnit.test(
|
||||||
|
"values are fetched w/o context (integer)",
|
||||||
|
async function (assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
|
|
||||||
var form = await testUtils.createView({
|
var form = await testUtils.createView({
|
||||||
|
@ -71,11 +76,12 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun
|
||||||
assert.containsOnce(form, "option[value='0']");
|
assert.containsOnce(form, "option[value='0']");
|
||||||
|
|
||||||
form.destroy();
|
form.destroy();
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
QUnit.test("values are fetched w/o context (selection)", async function (
|
QUnit.test(
|
||||||
assert
|
"values are fetched w/o context (selection)",
|
||||||
) {
|
async function (assert) {
|
||||||
assert.expect(2);
|
assert.expect(2);
|
||||||
|
|
||||||
var form = await testUtils.createView({
|
var form = await testUtils.createView({
|
||||||
|
@ -84,7 +90,10 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun
|
||||||
data: {
|
data: {
|
||||||
demo_entry: {
|
demo_entry: {
|
||||||
fields: {
|
fields: {
|
||||||
test_field: {string: "Test Field", type: "selection"},
|
test_field: {
|
||||||
|
string: "Test Field",
|
||||||
|
type: "selection",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
records: [{id: 1, test_field: ""}],
|
records: [{id: 1, test_field: ""}],
|
||||||
},
|
},
|
||||||
|
@ -105,9 +114,12 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun
|
||||||
assert.containsOnce(form, "option[value='\"value\"']");
|
assert.containsOnce(form, "option[value='\"value\"']");
|
||||||
|
|
||||||
form.destroy();
|
form.destroy();
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
QUnit.test("values are fetched with changing context", async function (assert) {
|
QUnit.test(
|
||||||
|
"values are fetched with changing context",
|
||||||
|
async function (assert) {
|
||||||
assert.expect(6);
|
assert.expect(6);
|
||||||
|
|
||||||
var form = await testUtils.createView({
|
var form = await testUtils.createView({
|
||||||
|
@ -168,6 +180,8 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun
|
||||||
assert.containsN(form, "option", 1);
|
assert.containsN(form, "option", 1);
|
||||||
|
|
||||||
form.destroy();
|
form.destroy();
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
);
|
||||||
|
|
Loading…
Reference in New Issue