diff --git a/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb b/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb index 4643cf34f..b468b2684 100644 --- a/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb +++ b/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb @@ -254,7 +254,7 @@ Discourse.Emoji.search = function(term, options) { for (i=0; i 0 && addResult(item)) { return results; } } diff --git a/test/javascripts/lib/emoji-test.js.es6 b/test/javascripts/lib/emoji-test.js.es6 index 4f3ba3c8e..3555ceb54 100644 --- a/test/javascripts/lib/emoji-test.js.es6 +++ b/test/javascripts/lib/emoji-test.js.es6 @@ -28,4 +28,7 @@ test("Emoji.search", function(){ // able to find an alias equal(Discourse.Emoji.search("+1").length, 1); + // able to find middle of line search + equal(Discourse.Emoji.search("check", {maxResults: 3}).length, 3); + });