aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/javascript/src/unit/consumer_test.js
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable/test/javascript/src/unit/consumer_test.js')
-rw-r--r--actioncable/test/javascript/src/unit/consumer_test.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/actioncable/test/javascript/src/unit/consumer_test.js b/actioncable/test/javascript/src/unit/consumer_test.js
new file mode 100644
index 0000000000..acc618bf0c
--- /dev/null
+++ b/actioncable/test/javascript/src/unit/consumer_test.js
@@ -0,0 +1,19 @@
+import consumerTest from "../test_helpers/consumer_test_helper"
+
+const {module} = QUnit
+
+module("ActionCable.Consumer", () => {
+ consumerTest("#connect", {connect: false}, ({consumer, server, assert, done}) => {
+ server.on("connection", () => {
+ assert.equal(consumer.connect(), false)
+ done()
+ })
+
+ consumer.connect()
+ })
+
+ consumerTest("#disconnect", ({consumer, client, done}) => {
+ client.addEventListener("close", done)
+ consumer.disconnect()
+ })
+})