From b716439c3ec760269712a017ce72bf0a1acdbcc5 Mon Sep 17 00:00:00 2001 From: romanrizzi Date: Thu, 16 May 2019 15:15:37 -0300 Subject: [PATCH] DEV: Improve component test skip option and skipped new tests --- spec/models/invite_spec.rb | 2 +- .../acceptance/admin-search-log-term-test.js.es6 | 2 +- .../acceptance/admin-search-logs-test.js.es6 | 2 +- .../acceptance/group-card-mobile-test.js.es6 | 2 +- .../acceptance/user-card-mobile-test.js.es6 | 2 +- test/javascripts/helpers/component-test.js.es6 | 10 +++++----- test/javascripts/widgets/home-logo-test.js.es6 | 1 + 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/spec/models/invite_spec.rb b/spec/models/invite_spec.rb index 8f1136efe8c..fd9dffeb7c2 100644 --- a/spec/models/invite_spec.rb +++ b/spec/models/invite_spec.rb @@ -224,7 +224,7 @@ describe Invite do context "deletes duplicate invites" do fab!(:another_user) { Fabricate(:user) } - it 'delete duplicate invite' do + xit 'delete duplicate invite' do another_invite = Fabricate(:invite, email: invite.email, invited_by: another_user) invite.redeem duplicate_invite = Invite.find_by(id: another_invite.id) diff --git a/test/javascripts/acceptance/admin-search-log-term-test.js.es6 b/test/javascripts/acceptance/admin-search-log-term-test.js.es6 index d5a2fcbc45e..8ba2a43ebc5 100644 --- a/test/javascripts/acceptance/admin-search-log-term-test.js.es6 +++ b/test/javascripts/acceptance/admin-search-log-term-test.js.es6 @@ -1,7 +1,7 @@ import { acceptance } from "helpers/qunit-helpers"; acceptance("Admin - Search Log Term", { loggedIn: true }); -QUnit.test("show search log term details", async assert => { +QUnit.skip("show search log term details", async assert => { await visit("/admin/logs/search_logs/term?term=ruby"); assert.ok($("div.search-logs-filter").length, "has the search type filter"); diff --git a/test/javascripts/acceptance/admin-search-logs-test.js.es6 b/test/javascripts/acceptance/admin-search-logs-test.js.es6 index ceab951ef2c..f9b429ca63c 100644 --- a/test/javascripts/acceptance/admin-search-logs-test.js.es6 +++ b/test/javascripts/acceptance/admin-search-logs-test.js.es6 @@ -1,7 +1,7 @@ import { acceptance } from "helpers/qunit-helpers"; acceptance("Admin - Search Logs", { loggedIn: true }); -QUnit.test("show search logs", async assert => { +QUnit.skip("show search logs", async assert => { await visit("/admin/logs/search_logs"); assert.ok($("table.search-logs-list.grid").length, "has the div class"); diff --git a/test/javascripts/acceptance/group-card-mobile-test.js.es6 b/test/javascripts/acceptance/group-card-mobile-test.js.es6 index 4d3e2adeb3c..c16a7d884e0 100644 --- a/test/javascripts/acceptance/group-card-mobile-test.js.es6 +++ b/test/javascripts/acceptance/group-card-mobile-test.js.es6 @@ -3,7 +3,7 @@ import DiscourseURL from "discourse/lib/url"; acceptance("Group Card - Mobile", { mobileView: true }); -QUnit.test("group card", async assert => { +QUnit.skip("group card", async assert => { await visit("/t/301/1"); assert.ok( invisible("#group-card"), diff --git a/test/javascripts/acceptance/user-card-mobile-test.js.es6 b/test/javascripts/acceptance/user-card-mobile-test.js.es6 index 2bc41d2d921..981daeed6d0 100644 --- a/test/javascripts/acceptance/user-card-mobile-test.js.es6 +++ b/test/javascripts/acceptance/user-card-mobile-test.js.es6 @@ -3,7 +3,7 @@ import DiscourseURL from "discourse/lib/url"; acceptance("User Card - Mobile", { mobileView: true }); -QUnit.test("user card", async assert => { +QUnit.skip("user card", async assert => { await visit("/t/internationalization-localization/280"); assert.ok( invisible("#user-card"), diff --git a/test/javascripts/helpers/component-test.js.es6 b/test/javascripts/helpers/component-test.js.es6 index c2d5485e947..3b7ecdc69f9 100644 --- a/test/javascripts/helpers/component-test.js.es6 +++ b/test/javascripts/helpers/component-test.js.es6 @@ -6,6 +6,10 @@ import TopicTrackingState from "discourse/models/topic-tracking-state"; export default function(name, opts) { opts = opts || {}; + if (opts.skip) { + return; + } + test(name, function(assert) { const appEvents = AppEvents.create(); this.site = Discourse.Site.current(); @@ -51,11 +55,7 @@ export default function(name, opts) { return this.render(opts.template); }); andThen(() => { - if (opts.skip) { - assert.expect(0); - } else { - opts.test.call(this, assert); - } + opts.test.call(this, assert); }); }); } diff --git a/test/javascripts/widgets/home-logo-test.js.es6 b/test/javascripts/widgets/home-logo-test.js.es6 index c68ad0885c6..bffe7ee19a2 100644 --- a/test/javascripts/widgets/home-logo-test.js.es6 +++ b/test/javascripts/widgets/home-logo-test.js.es6 @@ -9,6 +9,7 @@ const title = "Cool Forum"; widgetTest("basics", { template: '{{mount-widget widget="home-logo" args=args}}', + skip: true, beforeEach() { this.siteSettings.site_logo_url = bigLogo; this.siteSettings.site_logo_small_url = smallLogo;