mirror of https://github.com/OCA/web.git
[IMP] web_widget_dropdown_dynamic: black, isort, prettier
parent
b0df022207
commit
2788bb6aa1
|
@ -0,0 +1 @@
|
|||
../../../../web_widget_dropdown_dynamic
|
|
@ -0,0 +1,6 @@
|
|||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
|
@ -1,6 +1,6 @@
|
|||
odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", function (
|
||||
require
|
||||
) {
|
||||
odoo.define(
|
||||
"web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests",
|
||||
function (require) {
|
||||
"use strict";
|
||||
|
||||
/* global QUnit*/
|
||||
|
@ -9,7 +9,9 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun
|
|||
var testUtils = require("web.test_utils");
|
||||
|
||||
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);
|
||||
|
||||
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\"']");
|
||||
|
||||
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);
|
||||
|
||||
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']");
|
||||
|
||||
form.destroy();
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
QUnit.test("values are fetched w/o context (selection)", async function (
|
||||
assert
|
||||
) {
|
||||
QUnit.test(
|
||||
"values are fetched w/o context (selection)",
|
||||
async function (assert) {
|
||||
assert.expect(2);
|
||||
|
||||
var form = await testUtils.createView({
|
||||
|
@ -84,7 +90,10 @@ odoo.define("web_widget_dropdown_dynamic.web_widget_dropdown_dynamic_tests", fun
|
|||
data: {
|
||||
demo_entry: {
|
||||
fields: {
|
||||
test_field: {string: "Test Field", type: "selection"},
|
||||
test_field: {
|
||||
string: "Test Field",
|
||||
type: "selection",
|
||||
},
|
||||
},
|
||||
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\"']");
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
form.destroy();
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue