pretty code
This commit is contained in:
parent
e891eb1517
commit
32f883a7ad
|
@ -1,3 +1 @@
|
||||||
|
export default Ember.Component.extend({});
|
||||||
export default Ember.Component.extend({
|
|
||||||
});
|
|
||||||
|
|
|
@ -18,9 +18,10 @@ export default Ember.Component.extend({
|
||||||
const settings = Discourse.SiteSettings;
|
const settings = Discourse.SiteSettings;
|
||||||
|
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
"create_accounts": !user && settings.discourse_donations_enable_create_accounts,
|
create_accounts:
|
||||||
"stripe": Stripe(settings.discourse_donations_public_key),
|
!user && settings.discourse_donations_enable_create_accounts,
|
||||||
"color": jQuery("body").css("color"),
|
stripe: Stripe(settings.discourse_donations_public_key),
|
||||||
|
color: jQuery("body").css("color")
|
||||||
});
|
});
|
||||||
|
|
||||||
const types = settings.discourse_donations_types.split("|") || [];
|
const types = settings.discourse_donations_types.split("|") || [];
|
||||||
|
@ -108,8 +109,8 @@ export default Ember.Component.extend({
|
||||||
const style = {
|
const style = {
|
||||||
base: {
|
base: {
|
||||||
iconColor: color,
|
iconColor: color,
|
||||||
'::placeholder': { color: color },
|
"::placeholder": { color: color }
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const card = elements.create("card", { style, hidePostalCode });
|
const card = elements.create("card", { style, hidePostalCode });
|
||||||
|
|
|
@ -22,8 +22,7 @@ export default Ember.Controller.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
stripeTransationCompleteCtr() {
|
stripeTransationCompleteCtr() {},
|
||||||
},
|
|
||||||
|
|
||||||
loadDonations() {
|
loadDonations() {
|
||||||
let email = this.get("email");
|
let email = this.get("email");
|
||||||
|
|
|
@ -6,11 +6,17 @@ componentTest("donation form has content", {
|
||||||
template: `{{donation-form}}`,
|
template: `{{donation-form}}`,
|
||||||
|
|
||||||
beforeEach() {
|
beforeEach() {
|
||||||
this.registry.register('component:stripe-card', Ember.Component.extend({ tagName: 'dummy-component-tag' }));
|
this.registry.register(
|
||||||
|
"component:stripe-card",
|
||||||
|
Ember.Component.extend({ tagName: "dummy-component-tag" })
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
async test(assert) {
|
async test(assert) {
|
||||||
assert.ok(find('#payment-form').length, "The form renders");
|
assert.ok(find("#payment-form").length, "The form renders");
|
||||||
assert.ok(find('dummy-component-tag').length, "The stripe component renders");
|
assert.ok(
|
||||||
|
find("dummy-component-tag").length,
|
||||||
|
"The stripe component renders"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,7 +8,11 @@ componentTest("donation-row", {
|
||||||
test(assert) {
|
test(assert) {
|
||||||
assert.equal(find(".donation-row-currency").text(), "3", "It has currency");
|
assert.equal(find(".donation-row-currency").text(), "3", "It has currency");
|
||||||
assert.equal(find(".donation-row-amount").text(), "21", "It has an amount");
|
assert.equal(find(".donation-row-amount").text(), "21", "It has an amount");
|
||||||
assert.equal(find(".donation-row-period").text(), "monthly", "It has a period");
|
assert.equal(
|
||||||
|
find(".donation-row-period").text(),
|
||||||
|
"monthly",
|
||||||
|
"It has a period"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -21,6 +25,9 @@ componentTest("donation-row cancels subscription", {
|
||||||
},
|
},
|
||||||
|
|
||||||
async test(assert) {
|
async test(assert) {
|
||||||
assert.ok(find(".donation-row-subscription").length, "It has a subscription");
|
assert.ok(
|
||||||
|
find(".donation-row-subscription").length,
|
||||||
|
"It has a subscription"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue