DEV: Mark flaky tests as pending

DEV: Mark flaky tests as pending

diff --git a/spec/models/theme_spec.rb b/spec/models/theme_spec.rb
index 1c634eb..1f6eac0 100644
--- a/spec/models/theme_spec.rb
+++ b/spec/models/theme_spec.rb
@@ -67,7 +67,7 @@ describe Theme do
     expect(Theme.transform_ids([theme.id])).to be_empty
   end
 
-  it "#transform_ids works with nil values" do
+  xit "#transform_ids works with nil values" do
     # Used in safe mode
     expect(Theme.transform_ids([nil])).to eq([nil])
   end
diff --git a/spec/requests/admin/embeddable_hosts_controller_spec.rb b/spec/requests/admin/embeddable_hosts_controller_spec.rb
index f1da980..004afad 100644
--- a/spec/requests/admin/embeddable_hosts_controller_spec.rb
+++ b/spec/requests/admin/embeddable_hosts_controller_spec.rb
@@ -28,10 +28,9 @@ describe Admin::EmbeddableHostsController do
     end
 
     describe '#update' do
-      it "logs embeddable host update" do
-
+      xit "logs embeddable host update" do
         category = Fabricate(:category)
-
+        
         put "/admin/embeddable_hosts/#{embeddable_host.id}.json", params: {
           embeddable_host: { host: "test.com", class_name: "test-class", category_id: category.id }
         }
diff --git a/spec/requests/admin/users_controller_spec.rb b/spec/requests/admin/users_controller_spec.rb
index 451cf27..9ea3689 100644
--- a/spec/requests/admin/users_controller_spec.rb
+++ b/spec/requests/admin/users_controller_spec.rb
@@ -796,8 +796,6 @@ RSpec.describe Admin::UsersController do
       expect(u.name).to eq("Bill")
       expect(u.username).to eq("bill22")
       expect(u.admin).to eq(true)
-      expect(u.active).to eq(true)
-      expect(u.approved).to eq(true)
     end
 
     it "doesn't send the email with send_email falsey" do
diff --git a/test/javascripts/components/category-selector-test.js.es6 b/test/javascripts/components/category-selector-test.js.es6
index 264d685..07a5a98 100644
--- a/test/javascripts/components/category-selector-test.js.es6
+++ b/test/javascripts/components/category-selector-test.js.es6
@@ -64,8 +64,8 @@ componentTest("interactions", {
     this.set("categories", [Category.findById(2), Category.findById(6)]);
   },
 
+  skip: true,
   async test(assert) {
-    return assert.ok(true); // Flaky test. Marked as pending
     await this.get("subject").expand();
     await this.get("subject").selectRowByValue(8);
 
diff --git a/test/javascripts/components/mini-tag-chooser-test.js.es6 b/test/javascripts/components/mini-tag-chooser-test.js.es6
index 194f959..92f9b84 100644
--- a/test/javascripts/components/mini-tag-chooser-test.js.es6
+++ b/test/javascripts/components/mini-tag-chooser-test.js.es6
@@ -38,7 +38,7 @@ componentTest("default", {
       });
     });
   },
-
+  skip: true,
   async test(assert) {
     await this.get("subject").expand();
 
diff --git a/test/javascripts/components/multi-select-test.js.es6 b/test/javascripts/components/multi-select-test.js.es6
index 81c07bd..9b352cd 100644
--- a/test/javascripts/components/multi-select-test.js.es6
+++ b/test/javascripts/components/multi-select-test.js.es6
@@ -257,7 +257,7 @@ componentTest("with forceEscape", {
   beforeEach() {
     this.set("content", ["<div>sam</div>"]);
   },
-
+  skip: true,
   async test(assert) {
     await this.get("subject").expand();
 
diff --git a/test/javascripts/components/single-select-test.js.es6 b/test/javascripts/components/single-select-test.js.es6
index c0f1c29..695703f 100644
--- a/test/javascripts/components/single-select-test.js.es6
+++ b/test/javascripts/components/single-select-test.js.es6
@@ -768,9 +768,8 @@ componentTest("with accents in content", {
 componentTest("with no content and allowAny", {
   template: "{{single-select allowAny=true}}",
 
+  skip: true,
   async test(assert) {
-    return assert.ok(true); // Flaky test. Marked as pending
-
     await click(
       this.get("subject")
         .header()
diff --git a/test/javascripts/helpers/component-test.js.es6 b/test/javascripts/helpers/component-test.js.es6
index f5e15bc..c2d5485 100644
--- a/test/javascripts/helpers/component-test.js.es6
+++ b/test/javascripts/helpers/component-test.js.es6
@@ -50,6 +50,12 @@ export default function(name, opts) {
     andThen(() => {
       return this.render(opts.template);
     });
-    andThen(() => opts.test.call(this, assert));
+    andThen(() => {
+      if (opts.skip) {
+        assert.expect(0);
+      } else {
+        opts.test.call(this, assert);
+      }
+    });
   });
 }

GitHub sha: 84a3459a

Changes to spec/requests/admin/users_controller_spec.rb were reverted in next commit.

@SamSaffron I came up with a better way of skipping a componentTest. This commit fixes some issues that were discussed here: https://review.discourse.org/t/dev-mark-flaky-tests-as-pending-until-we-fix-them-7386

2 Likes

Ouch I fixed embeddable host update the other day, we should turn it back on

2 Likes