/** @odoo-module */ import { makeView, setupViewRegistries } from "@web/../tests/views/helpers"; import { getFixture, patchWithCleanup, click, nextTick, makeDeferred, } from "@web/../tests/helpers/utils"; import { session } from "@web/session"; import { registry } from "@web/core/registry"; const fakeStudioService = { start() { return { mode: null, }; }, }; QUnit.module("Studio Approval", (hooks) => { let target; let serverData; hooks.beforeEach(() => { target = getFixture(); serverData = { models: { partner: { fields: { display_name: { string: "Displayed name", type: "char" }, int_field: { string: "int_field", type: "integer", sortable: true }, bar: { string: "Bar", type: "boolean" }, }, records: [ { id: 1, display_name: "first record", int_field: 42, bar: true, }, { id: 2, display_name: "second record", int_field: 27, bar: true, }, ], }, }, }; setupViewRegistries(); registry.category("services").add("studio", fakeStudioService); }); QUnit.test("approval components are synchronous", async (assert) => { const prom = makeDeferred(); await makeView({ type: "form", resModel: "partner", serverData, arch: `