From 9902947e99db27aa192ced46e36b70e47df2a1da Mon Sep 17 00:00:00 2001 From: Rimian Perkins Date: Fri, 10 Jan 2020 16:47:28 +1100 Subject: [PATCH] a bit more testing --- .../acceptance/subscribe-test.js.es6 | 8 ++++++-- .../helpers/product-pretender.js.es6 | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/test/javascripts/acceptance/subscribe-test.js.es6 b/test/javascripts/acceptance/subscribe-test.js.es6 index af50606..7b9d8bf 100644 --- a/test/javascripts/acceptance/subscribe-test.js.es6 +++ b/test/javascripts/acceptance/subscribe-test.js.es6 @@ -12,6 +12,10 @@ acceptance("Discourse Subscriptions", { QUnit.test("subscribing", async assert => { await visit("/s"); - assert.ok($("#product-list").length, "has product page"); - assert.ok($(".product:first-child a").length, "has a link"); + await click(".product:first-child a"); + + assert.ok( + $(".discourse-subscriptions-section-columns").length, + "has a the sections for billing" + ); }); diff --git a/test/javascripts/helpers/product-pretender.js.es6 b/test/javascripts/helpers/product-pretender.js.es6 index 3e53515..14ccb40 100644 --- a/test/javascripts/helpers/product-pretender.js.es6 +++ b/test/javascripts/helpers/product-pretender.js.es6 @@ -19,4 +19,23 @@ export default function(helpers) { return response(products); }); + + this.get("/s/products/:id", () => { + const product = {}; + + return response(product); + }); + + this.get("/s/plans", () => { + const plans = [ + { + id: "plan_GHGHSHS8654G", + amount: 200, + currency: "usd", + interval: "month" + } + ]; + + return response(plans); + }); }