DEV: Fix imports in tests, minor clean up (#93)

DEV: Fix imports in tests, minor clean up (#93)

Still doesn’t work with ember cli though.

diff --git a/.gitignore b/.gitignore
index 2326635..3c3629e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1 @@
-auto_generated/
-.DS_Store
-node_modules/
-
-.rubocop-https---raw-githubusercontent-com-discourse-discourse-master--rubocop-yml
 node_modules
-yarn-error.log
-.rubocop-https---raw-githubusercontent-com-discourse-*
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1 @@
+{}
diff --git a/assets/javascripts/admin/controllers/modals/admin-plugins-chat-integration-edit-channel.js.es6 b/assets/javascripts/admin/controllers/modals/admin-plugins-chat-integration-edit-channel.js.es6
index 5c702b4..a626c09 100644
--- a/assets/javascripts/admin/controllers/modals/admin-plugins-chat-integration-edit-channel.js.es6
+++ b/assets/javascripts/admin/controllers/modals/admin-plugins-chat-integration-edit-channel.js.es6
@@ -2,11 +2,7 @@ import I18n from "I18n";
 import ModalFunctionality from "discourse/mixins/modal-functionality";
 import { popupAjaxError } from "discourse/lib/ajax-error";
 import EmberObject from "@ember/object";
-import {
-  default as computed,
-  observes,
-  on,
-} from "discourse-common/utils/decorators";
+import computed, { observes, on } from "discourse-common/utils/decorators";
 
 export default Ember.Controller.extend(ModalFunctionality, {
   @on("init")
diff --git a/assets/javascripts/admin/controllers/modals/admin-plugins-chat-integration-edit-rule.js.es6 b/assets/javascripts/admin/controllers/modals/admin-plugins-chat-integration-edit-rule.js.es6
index 740b2f6..062cefc 100644
--- a/assets/javascripts/admin/controllers/modals/admin-plugins-chat-integration-edit-rule.js.es6
+++ b/assets/javascripts/admin/controllers/modals/admin-plugins-chat-integration-edit-rule.js.es6
@@ -1,6 +1,6 @@
 import ModalFunctionality from "discourse/mixins/modal-functionality";
 import { popupAjaxError } from "discourse/lib/ajax-error";
-import { default as computed, on } from "discourse-common/utils/decorators";
+import computed, { on } from "discourse-common/utils/decorators";
 
 export default Ember.Controller.extend(ModalFunctionality, {
   saveDisabled: false,
diff --git a/assets/javascripts/admin/controllers/modals/admin-plugins-chat-integration-test.js.es6 b/assets/javascripts/admin/controllers/modals/admin-plugins-chat-integration-test.js.es6
index eaee5e2..254576e 100644
--- a/assets/javascripts/admin/controllers/modals/admin-plugins-chat-integration-test.js.es6
+++ b/assets/javascripts/admin/controllers/modals/admin-plugins-chat-integration-test.js.es6
@@ -2,7 +2,7 @@ import I18n from "I18n";
 import ModalFunctionality from "discourse/mixins/modal-functionality";
 import { ajax } from "discourse/lib/ajax";
 import { popupAjaxError } from "discourse/lib/ajax-error";
-import { default as computed, on } from "discourse-common/utils/decorators";
+import computed, { on } from "discourse-common/utils/decorators";
 
 export default Ember.Controller.extend(ModalFunctionality, {
   @on("init")
diff --git a/assets/javascripts/admin/models/rule.js.es6 b/assets/javascripts/admin/models/rule.js.es6
index af27839..a1e0aca 100644
--- a/assets/javascripts/admin/models/rule.js.es6
+++ b/assets/javascripts/admin/models/rule.js.es6
@@ -1,10 +1,7 @@
 import I18n from "I18n";
 import RestModel from "discourse/models/rest";
 import Category from "discourse/models/category";
-import {
-  default as computed,
-  observes,
-} from "discourse-common/utils/decorators";
+import computed, { observes } from "discourse-common/utils/decorators";
 
 export default RestModel.extend({
   @computed("channel.provider")
diff --git a/assets/javascripts/admin/templates/modal/admin-plugins-chat-integration-edit-channel.hbs b/assets/javascripts/admin/templates/modal/admin-plugins-chat-integration-edit-channel.hbs
index b769f62..051f08e 100644
--- a/assets/javascripts/admin/templates/modal/admin-plugins-chat-integration-edit-channel.hbs
+++ b/assets/javascripts/admin/templates/modal/admin-plugins-chat-integration-edit-channel.hbs
@@ -45,14 +45,14 @@
 <div class="modal-footer">
   {{d-button id="save-channel"
     class="btn-primary btn-large"
-    action="save"
+    action=(action "save")
     title="chat_integration.edit_channel_modal.save"
     label="chat_integration.edit_channel_modal.save"
     disabled=saveDisabled
   }}
 
   {{d-button class="btn-large"
-    action="cancel"
+    action=(action "cancel")
     title="chat_integration.edit_channel_modal.cancel"
     label="chat_integration.edit_channel_modal.cancel"
   }}
diff --git a/assets/javascripts/admin/templates/modal/admin-plugins-chat-integration-edit-rule.hbs b/assets/javascripts/admin/templates/modal/admin-plugins-chat-integration-edit-rule.hbs
index 2fe03b5..c3affd5 100644
--- a/assets/javascripts/admin/templates/modal/admin-plugins-chat-integration-edit-rule.hbs
+++ b/assets/javascripts/admin/templates/modal/admin-plugins-chat-integration-edit-rule.hbs
@@ -105,7 +105,7 @@
 <div class="modal-footer">
   {{d-button id="save-rule"
     class="btn-primary btn-large"
-    action="save"
+    action=(action "save")
     actionParam=model.rule
     title="chat_integration.edit_rule_modal.save"
     label="chat_integration.edit_rule_modal.save"
diff --git a/assets/javascripts/discourse/templates/components/channel-details.hbs b/assets/javascripts/discourse/templates/components/channel-details.hbs
index ccfda7b..532630d 100644
--- a/assets/javascripts/discourse/templates/components/channel-details.hbs
+++ b/assets/javascripts/discourse/templates/components/channel-details.hbs
@@ -18,7 +18,7 @@
     }}
 
     {{d-button
-      class="cancel"
+      class="cancel delete-channel"
       action=(action "deleteChannel")
       actionParam=channel
       icon="trash-alt"
diff --git a/test/javascripts/acceptance/chat-integration-test.js.es6 b/test/javascripts/acceptance/chat-integration-test.js.es6
index bb7bb0a..8fe392f 100755
--- a/test/javascripts/acceptance/chat-integration-test.js.es6
+++ b/test/javascripts/acceptance/chat-integration-test.js.es6
@@ -1,21 +1,24 @@
-import { acceptance } from "discourse/tests/helpers/qunit-helpers";
+import {
+  acceptance,
+  exists,
+  query,
+  queryAll,
+} from "discourse/tests/helpers/qunit-helpers";
+import { test } from "qunit";
+import { click, fillIn, triggerKeyEvent, visit } from "@ember/test-helpers";
+
+const response = (object) => {
+  return [200, { "Content-Type": "text/html; charset=utf-8" }, object];
+};
+
+const jsonResponse = (object) => {
+  return [200, { "Content-Type": "application/json; charset=utf-8" }, object];
+};
 
 acceptance("Chat Integration", function (needs) {
   needs.user();
 
   needs.pretender((server) => {
-    const response = (object) => {
-      return [200, { "Content-Type": "text/html; charset=utf-8" }, object];
-    };
-
-    const jsonResponse = (object) => {
-      return [
-        200,
-        { "Content-Type": "application/json; charset=utf-8" },
-        object,
-      ];
-    };
-
     server.get("/admin/plugins/chat-integration/providers", () => {
       return jsonResponse({
         providers: [
@@ -85,7 +88,7 @@ acceptance("Chat Integration", function (needs) {
     });
   });
 
-  test("Rules load successfully", async (assert) => {
+  test("Rules load successfully", async function (assert) {
     await visit("/admin/plugins/chat-integration");
 
     assert.ok(
@@ -93,14 +96,14 @@ acceptance("Chat Integration", function (needs) {
       "it shows the table of rules"
     );
 
-    assert.equal(
-      find("#admin-plugin-chat table tr td").eq(0).text().trim(),
+    assert.strictEqual(
+      queryAll("#admin-plugin-chat table tr td")[0].innerText.trim(),
       "All posts and replies",
       "rule displayed"
     );
   });
 
-  test("Create channel works", async (assert) => {
+  test("Create channel works", async function (assert) {
     await visit("/admin/plugins/chat-integration");
     await click("#create-channel");
 

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

GitHub sha: 369ca147113dbef82aa6577c6ef0f215c6d9c4eb

This commit appears in #93 which was approved by davidtaylorhq. It was merged by CvX.