summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorlul-odoo <lul@odoo.com>2019-06-27 10:23:17 +0200
committerYannick Tivisse <yti@odoo.com>2019-06-27 10:24:40 +0200
commit1c99c251c9a1e7e6642efae302ac3b83e18e0d9b (patch)
tree3e586218dc03e7143cb0cf2ef816533f2f593646 /addons/web/static/src/js/fields/basic_fields.js
parent7ea21adabe007eff6b5b69aa451d756dff54442b (diff)
[IMP] web: Add QUnit tests for the SwitchCompanyMenu
Purpose ======= This commit tests some behaviors with multi company mode after changes brought by f847a46. Specification ============= Ensure the robustness of the switch company menu for multiple cases like: - Bar rendering - Switch to another company in mono/multi environment - Toggle another company in mono/multi environment - Remove a company in mono/multi environment The widget itself has been slighty modified to make it more testable: - Reading from session is now in the `willStart` function instead of `init` to allow mocking the session (in tests, `init` is executed before the mock is applied). - In the event handlers, don't use `bbq` to retrieve current allowed company ids. `bbq` is not easily nor cleanly patched. - When reading allowed company ids from session, cast ids from string to integer. They are everywhere casted except there. and some linting
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
0 files changed, 0 insertions, 0 deletions