From a1a7ca98a35f9e074931ebd168f4a622c9cc125e Mon Sep 17 00:00:00 2001 From: Justin DiRose Date: Tue, 28 Jul 2020 15:40:16 -0500 Subject: [PATCH] DEV: Fix tests --- assets/javascripts/discourse/components/payment-options.js.es6 | 2 +- test/javascripts/acceptance/payments-test.js.es6 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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"); });