diff --git a/addons/web/static/src/js/views/kanban/kanban_column_quick_create.js b/addons/web/static/src/js/views/kanban/kanban_column_quick_create.js index c4bed5faa05..928f80ab60f 100644 --- a/addons/web/static/src/js/views/kanban/kanban_column_quick_create.js +++ b/addons/web/static/src/js/views/kanban/kanban_column_quick_create.js @@ -32,7 +32,7 @@ var ColumnQuickCreate = Widget.extend({ */ init: function (parent, options) { this._super.apply(this, arguments); - this.applyExamplesText = options.applyExampleText || _t("Use This For My Kanban"); + this.applyExamplesText = options.applyExamplesText || _t("Use This For My Kanban"); this.examples = options.examples; this.folded = true; this.isMobile = false; diff --git a/addons/web/static/tests/views/kanban_tests.js b/addons/web/static/tests/views/kanban_tests.js index 0450876be78..f3de29c8b42 100644 --- a/addons/web/static/tests/views/kanban_tests.js +++ b/addons/web/static/tests/views/kanban_tests.js @@ -3801,6 +3801,47 @@ QUnit.module('Views', { kanban.destroy(); }); + QUnit.test("quick create column's apply button's display text", async function (assert) { + assert.expect(1); + + const applyExamplesText = 'Use This For My Test'; + kanbanExamplesRegistry.add('test', { + applyExamplesText: applyExamplesText, + examples:[{ + name: "A first example", + columns: ["Column 1", "Column 2", "Column 3"], + description: "Some description", + }, { + name: "A second example", + columns: ["Col 1", "Col 2"], + }], + }); + + var kanban = await createView({ + View: KanbanView, + model: 'partner', + data: this.data, + arch: '' + + '' + + '' + + '
' + + '
' + + '
', + groupBy: ['product_id'], + }); + + // open the quick create + await testUtils.dom.click(kanban.$('.o_column_quick_create .o_quick_create_folded')); + + // click to see the examples + await testUtils.dom.click(kanban.$('.o_column_quick_create .o_kanban_examples')); + + const $primaryActionButton = $('.modal footer.modal-footer button.btn-primary > span'); + assert.strictEqual($primaryActionButton.text(), applyExamplesText, 'the primary button should display the value of applyExamplesText'); + + kanban.destroy(); + }); + QUnit.test('quick create column and examples background with ghostColumns titles', async function (assert) { assert.expect(4);