Skip to content

[IMP] web_widget_dropdown_dynamic: Remove QUnit import from tests - #3145

Merged
OCA-git-bot merged 1 commit into
OCA:18.0from
ForgeFlow:18.0-imp-web_widget_dropdown_dynamic
Apr 21, 2025
Merged

OCA-git-bot merged 1 commit into
OCA:18.0from
ForgeFlow:18.0-imp-web_widget_dropdown_dynamic

Conversation

@JasminSForgeFlow

@JasminSForgeFlow JasminSForgeFlow commented Apr 1, 2025

Copy link
Copy Markdown
Contributor

Fix tests issue in #3136

@JasminSForgeFlow
JasminSForgeFlow force-pushed the 18.0-imp-web_widget_dropdown_dynamic branch from 03583c0 to 17cc86c Compare April 1, 2025 05:57
@JasminSForgeFlow
JasminSForgeFlow force-pushed the 18.0-imp-web_widget_dropdown_dynamic branch from fb4588a to 6d444f5 Compare April 1, 2025 07:16
/* eslint-disable no-undef */
import {editInput, getFixture} from "@web/../tests/helpers/utils";
import {makeView, setupViewRegistries} from "@web/../tests/views/helpers";
import {QUnit} from "@web/static/lib/qunit/qunit";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it QUnit used a bit below? Could you explain the rationale behind the patch?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't require import as it's js lib

and causing this issue in web_timeline tests

2025-04-01 07:14:55,423 270 ERROR odoo odoo.addons.web_timeline.tests.test_web_timeline.TestWebTimeline.test_timeline_arch.browser: The following modules are needed by other modules but have not been defined, they may not be present in the correct asset bundle: ['@web/static/lib/qunit/qunit']

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
cc @pedrobaeza

@@ -1,8 +1,6 @@
/** @odoo-module **/

/* eslint-disable no-undef */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why disabling this linter?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's giving the below error

web/web_widget_dropdown_dynamic/static/tests/web_widget_dropdown_dynamic_tests.esm.js
    7:1  error  'QUnit' is not defined  no-undef
   38:5  error  'QUnit' is not defined  no-undef
   91:5  error  'QUnit' is not defined  no-undef
  122:5  error  'QUnit' is not defined  no-undef
  149:5  error  'QUnit' is not defined  no-undef

✖ 5 problems (5 errors, 0 warnings)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, and that's because you are removing the import, so for me, you shouldn't do it. I don't see the relation of this with the error in #3136 @CarlosRoca13 can you maybe help here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In odoo 18.0, is not needed to import QUnit because it is declared as global https://github.com/odoo/odoo/blob/4b6770ec30bd00213674df2b075c77f33a0e65d9/addons/web/static/src/%40types/libs.d.ts#L5

So we should add here the key

web/eslint.config.cjs

Lines 10 to 21 in 514c425

globals: {
_: "readonly",
$: "readonly",
fuzzy: "readonly",
jQuery: "readonly",
moment: "readonly",
odoo: "readonly",
openerp: "readonly",
owl: "readonly",
luxon: "readonly",
...globals.browser,
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that be in the copier template?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sure

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase and remove the linter line 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks

@JasminSForgeFlow
JasminSForgeFlow force-pushed the 18.0-imp-web_widget_dropdown_dynamic branch from 6d444f5 to de4c892 Compare April 21, 2025 08:21

@CarlosRoca13 CarlosRoca13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

@CarlosRoca13

Copy link
Copy Markdown
Contributor

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 18.0-ocabot-merge-pr-3145-by-CarlosRoca13-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 2eb41fb into OCA:18.0 Apr 21, 2025
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 55459fa. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants