diff options
| author | true-datura <grrrr@protonmail.com> | 2018-03-07 17:55:23 +0200 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-03-08 14:29:36 +0100 |
| commit | 67f67b512477d7c87e47076468f7dadb144e1da8 (patch) | |
| tree | 2c52a1cf98a69bbcd4caedcf8335e3ca4c828904 /addons/web/static/tests | |
| parent | 6faf7784e6f3c45dd6fd30b7183336b8e5838a3f (diff) | |
[FIX] web: 'image_small' field not displayed for non-latin translations
Before this commit, images in kanban view of the Contact app were not displayed
on non-latin languages, such as Russian.
This was caused by the is_bin_size helper that wrongly assumes that a certain
string is not a binary size, although it is (e.g. 64.2 Кб).
This commit fixes the issue by including such strings as valid binary sizes.
Bug found and fixed by @true-datura
Test by @alexkuhn
closes #23526
closes #22519
Diffstat (limited to 'addons/web/static/tests')
| -rw-r--r-- | addons/web/static/tests/core/util_tests.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/addons/web/static/tests/core/util_tests.js b/addons/web/static/tests/core/util_tests.js index 204503117e6..c7158083dcb 100644 --- a/addons/web/static/tests/core/util_tests.js +++ b/addons/web/static/tests/core/util_tests.js @@ -44,6 +44,17 @@ QUnit.module('core', {}, function () { assert.strictEqual(intersperse("12345678", [3,0], '.'), '12.345.678'); }); + QUnit.test('is_bin_size', function (assert) { + assert.expect(3); + + var is_bin_size = utils.is_bin_size; + + assert.strictEqual(is_bin_size('Cg=='), false); + assert.strictEqual(is_bin_size('2.5 Mb'), true); + // should also work for non-latin languages (e.g. russian) + assert.strictEqual(is_bin_size('64.2 Кб'), true); + }); + }); });
\ No newline at end of file |
