summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/components
diff options
context:
space:
mode:
authorPriyanka Kakadiya <pka@odoo.com>2021-03-25 13:10:14 +0000
committerPriyanka Kakadiya <pka@odoo.com>2021-03-26 10:33:55 +0000
commit2208a9b5e18881f5fbfea56872990daafba45579 (patch)
tree73b1f73e2861e13e15b385f09314a0e01dce742a /addons/mail/static/src/components
parent2e1bcb079ec361d85a80d790b8a2cc395055f09a (diff)
[FIX] mail: command suggestion should only show if '/' is first char
PURPOSE: command suggestion should only open if command is the first char. SPECIFICATION: command suggestion should only open if command is the first char. Task-2487518 closes odoo/odoo#68376 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/mail/static/src/components')
-rw-r--r--addons/mail/static/src/components/composer/composer_tests.js16
1 files changed, 4 insertions, 12 deletions
diff --git a/addons/mail/static/src/components/composer/composer_tests.js b/addons/mail/static/src/components/composer/composer_tests.js
index da0a2fb2901..a4ff5978952 100644
--- a/addons/mail/static/src/components/composer/composer_tests.js
+++ b/addons/mail/static/src/components/composer/composer_tests.js
@@ -857,8 +857,8 @@ QUnit.test("channel with no commands should not prompt any command suggestions o
);
});
-QUnit.test('use a command after some text', async function (assert) {
- assert.expect(5);
+QUnit.test('command suggestion should only open if command is the first character', async function (assert) {
+ assert.expect(4);
this.data['mail.channel'].records.push({ channel_type: 'channel', id: 20 });
this.data['mail.channel_command'].records.push(
@@ -900,18 +900,10 @@ QUnit.test('use a command after some text', async function (assert) {
document.querySelector(`.o_ComposerTextInput_textarea`)
.dispatchEvent(new window.KeyboardEvent('keyup'));
});
- assert.containsOnce(
+ assert.containsNone(
document.body,
'.o_ComposerSuggestion',
- "should have a command suggestion"
- );
- await afterNextRender(() =>
- document.querySelector('.o_ComposerSuggestion').click()
- );
- assert.strictEqual(
- document.querySelector(`.o_ComposerTextInput_textarea`).value.replace(/\s/, " "),
- "bluhbluh /who ",
- "text content of composer should have previous content + used command + additional whitespace afterwards"
+ "should not have a command suggestion"
);
});