diff --git a/assets/javascripts/discourse/components/payment-options.js.es6 b/assets/javascripts/discourse/components/payment-options.js.es6 index f8616c6..d5eec95 100644 --- a/assets/javascripts/discourse/components/payment-options.js.es6 +++ b/assets/javascripts/discourse/components/payment-options.js.es6 @@ -3,7 +3,7 @@ import Component from "@ember/component"; export default Component.extend({ init() { this._super(...arguments); - if (this.plans.length === 1) { + if (this.plans && this.plans.length === 1) { this.set("selectedPlan", this.plans[0].id); } }, diff --git a/test/javascripts/acceptance/payments-test.js.es6 b/test/javascripts/acceptance/payments-test.js.es6 index 998f69f..8a8aa18 100644 --- a/test/javascripts/acceptance/payments-test.js.es6 +++ b/test/javascripts/acceptance/payments-test.js.es6 @@ -12,6 +12,6 @@ acceptance("Discourse Subscriptions", { QUnit.test("viewing product page", async assert => { await visit("/s"); - assert.ok($("#product-list").length, "has product page"); + assert.ok($(".product-list").length, "has product page"); assert.ok($(".product:first-child a").length, "has a link"); });