From 87f6aadb7e890325d9271d1787e25daa569ecd42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 24 Aug 2016 22:53:43 +0200 Subject: [PATCH] FIX: topic discovery tests --- test/javascripts/acceptance/topic-discovery-test.js.es6 | 4 +--- test/javascripts/helpers/assertions.js | 2 +- test/javascripts/helpers/site-settings.js | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/test/javascripts/acceptance/topic-discovery-test.js.es6 b/test/javascripts/acceptance/topic-discovery-test.js.es6 index b5c200428..792b7ab7f 100644 --- a/test/javascripts/acceptance/topic-discovery-test.js.es6 +++ b/test/javascripts/acceptance/topic-discovery-test.js.es6 @@ -18,9 +18,7 @@ test("Visit Discovery Pages", () => { visit("/categories"); andThen(() => { ok($('body.category-bug').length === 0, "removes the custom category class"); - - // TODO: NEED TO FIX THIS - // ok(exists('.category'), "has a list of categories"); + ok(exists('.category'), "has a list of categories"); ok($('body.categories-list').length, "has a custom class to indicate categories"); }); diff --git a/test/javascripts/helpers/assertions.js b/test/javascripts/helpers/assertions.js index b5fa2a0f4..66b6fc8f8 100644 --- a/test/javascripts/helpers/assertions.js +++ b/test/javascripts/helpers/assertions.js @@ -1,7 +1,7 @@ /* exported exists, count, present, blank, containsInstance, not, visible, invisible */ function exists(selector) { - return !!count(selector); + return count(selector) > 0; } function count(selector) { diff --git a/test/javascripts/helpers/site-settings.js b/test/javascripts/helpers/site-settings.js index d25c3b43c..a0db9b5e0 100644 --- a/test/javascripts/helpers/site-settings.js +++ b/test/javascripts/helpers/site-settings.js @@ -92,6 +92,7 @@ Discourse.SiteSettingsOriginal = { "available_locales":"cs|da|de|en|es|fr|he|id|it|ja|ko|nb_NO|nl|pl_PL|pt|pt_BR|ru|sv|uk|zh_CN|zh_TW", "highlighted_languages":"apache|bash|cs|cpp|css|coffeescript|diff|xml|http|ini|json|java|javascript|makefile|markdown|nginx|objectivec|ruby|perl|php|python|sql|handlebars", "enable_emoji":true, - "emoji_set":"emoji_one" + "emoji_set":"emoji_one", + "desktop_category_page_style":"categories_and_latest_topics" }; Discourse.SiteSettings = jQuery.extend(true, {}, Discourse.SiteSettingsOriginal);