Rename all test files from JS -> ES6

Rename all test files from JS -> ES6

diff --git a/lib/discourse_js_processor.rb b/lib/discourse_js_processor.rb
index bbadfa8..4060b16 100644
--- a/lib/discourse_js_processor.rb
+++ b/lib/discourse_js_processor.rb
@@ -36,24 +36,27 @@ class DiscourseJsProcessor
     return false unless filename.end_with?(".js") || filename.end_with?(".js.erb")
 
     relative_path = filename.sub(Rails.root.to_s, '').sub(/^\/*/, '')
-    relative_path.start_with?("app/assets/javascripts/discourse/") ||
-      relative_path.start_with?("app/assets/javascripts/admin/") ||
-      relative_path.start_with?("app/assets/javascripts/pretty-text/") ||
-      relative_path.start_with?("app/assets/javascripts/select-kit/") ||
-      relative_path.start_with?("app/assets/javascripts/wizard/") ||
-      relative_path.start_with?("app/assets/javascripts/discourse-common/") ||
-      relative_path.start_with?("app/assets/javascripts/ember-addons/") ||
-      relative_path.start_with?("app/assets/javascripts/confirm-new-email/") ||
-      relative_path == "app/assets/javascripts/preload-store.js" ||
-      relative_path == "app/assets/javascripts/preload-application-data.js" ||
-      relative_path == "app/assets/javascripts/wizard-start.js" ||
-      relative_path == "app/assets/javascripts/onpopstate-handler.js" ||
-      relative_path == "app/assets/javascripts/discourse.js" ||
-      relative_path == "app/assets/javascripts/google-tag-manager.js" ||
-      relative_path == "app/assets/javascripts/google-universal-analytics.js" ||
-      relative_path == "app/assets/javascripts/activate-account.js" ||
-      relative_path == "app/assets/javascripts/auto-redirect.js" ||
-      relative_path == "app/assets/javascripts/embed-application.js"
+
+    js_root = "app/assets/javascripts"
+    test_root = "test/javascripts"
+
+    return false if relative_path.start_with?("#{js_root}/locales/")
+
+    return true if %w(
+      preload-store
+      preload-application-data
+      wizard-start
+      onpopstate-handler
+      discourse
+      google-tag-manager
+      google-universal-analytics.js
+      activate-account.js
+      auto-redirect.js
+      embed-application
+    ).any? { |f| relative_path == "#{js_root}/#{f}.js" }
+
+    relative_path =~ /^#{js_root}\/[^\/]+\// ||
+      relative_path =~ /^#{test_root}\/[^\/]+\//
   end
 
   def self.skip_module?(data)
diff --git a/test/javascripts/acceptance/about-test.js b/test/javascripts/acceptance/about-test.js
new file mode 100644
index 0000000..3c2d39a
--- /dev/null
+++ b/test/javascripts/acceptance/about-test.js
@@ -0,0 +1,11 @@
+import { acceptance } from "helpers/qunit-helpers";
+acceptance("About");
+
+QUnit.test("viewing", async assert => {
+  await visit("/about");
+
+  assert.ok($("body.about-page").length, "has body class");
+  assert.ok(exists(".about.admins .user-info"), "has admins");
+  assert.ok(exists(".about.moderators .user-info"), "has moderators");
+  assert.ok(exists(".about.stats tr td"), "has stats");
+});
diff --git a/test/javascripts/acceptance/about-test.js.es6 b/test/javascripts/acceptance/about-test.js.es6
deleted file mode 100644
index 3c2d39a..0000000
--- a/test/javascripts/acceptance/about-test.js.es6
+++ /dev/null
@@ -1,11 +0,0 @@
-import { acceptance } from "helpers/qunit-helpers";
-acceptance("About");
-
-QUnit.test("viewing", async assert => {
-  await visit("/about");
-
-  assert.ok($("body.about-page").length, "has body class");
-  assert.ok(exists(".about.admins .user-info"), "has admins");
-  assert.ok(exists(".about.moderators .user-info"), "has moderators");
-  assert.ok(exists(".about.stats tr td"), "has stats");
-});
diff --git a/test/javascripts/acceptance/account-created-test.js b/test/javascripts/acceptance/account-created-test.js
new file mode 100644
index 0000000..e9d57d9
--- /dev/null
+++ b/test/javascripts/acceptance/account-created-test.js
@@ -0,0 +1,92 @@
+import { acceptance } from "helpers/qunit-helpers";
+import PreloadStore from "preload-store";
+
+acceptance("Account Created");
+
+QUnit.test("account created - message", async assert => {
+  PreloadStore.store("accountCreated", {
+    message: "Hello World"
+  });
+  await visit("/u/account-created");
+
+  assert.ok(exists(".account-created"));
+  assert.equal(
+    find(".account-created .ac-message")
+      .text()
+      .trim(),
+    "Hello World",
+    "it displays the message"
+  );
+  assert.notOk(exists(".activation-controls"));
+});
+
+QUnit.test("account created - resend email", async assert => {
+  PreloadStore.store("accountCreated", {
+    message: "Hello World",
+    username: "eviltrout",
+    email: "eviltrout@example.com",
+    show_controls: true
+  });
+
+  await visit("/u/account-created");
+
+  assert.ok(exists(".account-created"));
+  assert.equal(
+    find(".account-created .ac-message")
+      .text()
+      .trim(),
+    "Hello World",
+    "it displays the message"
+  );
+
+  await click(".activation-controls .resend");
+
+  assert.equal(currentPath(), "account-created.resent");
+  const email = find(".account-created .ac-message b").text();
+  assert.equal(email, "eviltrout@example.com");
+});
+
+QUnit.test("account created - update email - cancel", async assert => {
+  PreloadStore.store("accountCreated", {
+    message: "Hello World",
+    username: "eviltrout",
+    email: "eviltrout@example.com",
+    show_controls: true
+  });
+
+  await visit("/u/account-created");
+
+  await click(".activation-controls .edit-email");
+
+  assert.equal(currentPath(), "account-created.edit-email");
+  assert.ok(find(".activation-controls .btn-primary:disabled").length);
+
+  await click(".activation-controls .edit-cancel");
+
+  assert.equal(currentPath(), "account-created.index");
+});
+
+QUnit.test("account created - update email - submit", async assert => {
+  PreloadStore.store("accountCreated", {
+    message: "Hello World",
+    username: "eviltrout",
+    email: "eviltrout@example.com",
+    show_controls: true
+  });
+
+  await visit("/u/account-created");
+
+  await click(".activation-controls .edit-email");
+
+  assert.ok(find(".activation-controls .btn-primary:disabled").length);
+
+  await fillIn(".activate-new-email", "newemail@example.com");
+
+  assert.notOk(find(".activation-controls .btn-primary:disabled").length);
+
+  await click(".activation-controls .btn-primary");
+
+  assert.equal(currentPath(), "account-created.resent");
+  const email = find(".account-created .ac-message b").text();
+  assert.equal(email, "newemail@example.com");
+});
diff --git a/test/javascripts/acceptance/account-created-test.js.es6 b/test/javascripts/acceptance/account-created-test.js.es6
deleted file mode 100644
index e9d57d9..0000000
--- a/test/javascripts/acceptance/account-created-test.js.es6
+++ /dev/null
@@ -1,92 +0,0 @@
-import { acceptance } from "helpers/qunit-helpers";
-import PreloadStore from "preload-store";
-
-acceptance("Account Created");
-
-QUnit.test("account created - message", async assert => {
-  PreloadStore.store("accountCreated", {
-    message: "Hello World"
-  });
-  await visit("/u/account-created");
-
-  assert.ok(exists(".account-created"));
-  assert.equal(
-    find(".account-created .ac-message")
-      .text()
-      .trim(),
-    "Hello World",
-    "it displays the message"
-  );
-  assert.notOk(exists(".activation-controls"));
-});
-
-QUnit.test("account created - resend email", async assert => {
-  PreloadStore.store("accountCreated", {
-    message: "Hello World",
-    username: "eviltrout",
-    email: "eviltrout@example.com",
-    show_controls: true
-  });
-
-  await visit("/u/account-created");
-
-  assert.ok(exists(".account-created"));
-  assert.equal(
-    find(".account-created .ac-message")
-      .text()
-      .trim(),
-    "Hello World",
-    "it displays the message"
-  );
-
-  await click(".activation-controls .resend");
-
-  assert.equal(currentPath(), "account-created.resent");
-  const email = find(".account-created .ac-message b").text();
-  assert.equal(email, "eviltrout@example.com");
-});
-

[... diff too long, it was truncated ...]

GitHub sha: 2abe85b8