Add new plugin files.
This gets the plugin running again without name collisions. A solid starting point
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
import componentTest from "helpers/component-test";
|
||||
|
||||
moduleForComponent("donation-form", { integration: true });
|
||||
|
||||
componentTest("donation form has content", {
|
||||
template: `{{donation-form}}`,
|
||||
|
||||
beforeEach() {
|
||||
this.registry.register(
|
||||
"component:stripe-card",
|
||||
Ember.Component.extend({ tagName: "dummy-component-tag" })
|
||||
);
|
||||
},
|
||||
|
||||
async test(assert) {
|
||||
assert.ok(find("#payment-form").length, "The form renders");
|
||||
assert.ok(
|
||||
find("dummy-component-tag").length,
|
||||
"The stripe component renders"
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -1,33 +0,0 @@
|
||||
import componentTest from "helpers/component-test";
|
||||
|
||||
moduleForComponent("donation-row", { integration: true });
|
||||
|
||||
componentTest("donation-row", {
|
||||
template: `{{donation-row currency=3 amount=21 period='monthly'}}`,
|
||||
|
||||
test(assert) {
|
||||
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-period").text(),
|
||||
"monthly",
|
||||
"It has a period"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
componentTest("donation-row cancels subscription", {
|
||||
template: `{{donation-row currentUser=currentUser subscription=subscription}}`,
|
||||
|
||||
beforeEach() {
|
||||
this.set("currentUser", true);
|
||||
this.set("subscription", true);
|
||||
},
|
||||
|
||||
async test(assert) {
|
||||
assert.ok(
|
||||
find(".donation-row-subscription").length,
|
||||
"It has a subscription"
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -1,33 +0,0 @@
|
||||
import componentTest from "helpers/component-test";
|
||||
|
||||
moduleForComponent("stripe-card", { integration: true });
|
||||
|
||||
window.Stripe = function() {
|
||||
return {
|
||||
elements: function() {
|
||||
return {
|
||||
create: function() {
|
||||
return {
|
||||
mount: function() {},
|
||||
card: function() {}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
componentTest("stripe card", {
|
||||
template: `{{stripe-card donateAmounts=donateAmounts}}`,
|
||||
|
||||
skip: true,
|
||||
|
||||
beforeEach() {
|
||||
Discourse.SiteSettings.discourse_donations_types = "";
|
||||
this.set("donateAmounts", [{ value: 2 }]);
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
assert.ok(true);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user