Skip to content

Commit

Permalink
Merge branch 'release-1.1.1' into circle-rc-deployments
Browse files Browse the repository at this point in the history
* release-1.1.1:
  1994 Console Dropzone Warnings (#2138)
  Fix linting error (#2140)
  missing word added to Readme
  Update read only Quantity in top variant #1919 (#2065)
  Add import, adjust Proptypes
  Fix missing import
  Docker base v1.3.0 (#2129)
  Fix async tests (#2128)
  • Loading branch information
jshimko committed Apr 19, 2017
2 parents 755527b + 8a32695 commit 1a195a8
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 131 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM reactioncommerce/base:v1.2.2
FROM reactioncommerce/base:v1.3.0

# Default environment variables
ENV ROOT_URL "http://localhost"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Docker images are pushed when Reaction sucessfully builds and passes all tests o

### Contributing

Want to contribute? That's great! [Here's you can get started](https://guides.github.com/activities/contributing-to-open-source/#contributing).
Want to contribute? That's great! [Here's how you can get started](https://guides.github.com/activities/contributing-to-open-source/#contributing).

Check out our Issues page, and if you find something you want to work on, let us know in the comments. If you're interested in a particular [project](https://github.com/reactioncommerce/reaction/projects) and you aren’t sure where to begin, feel free to ask. Start small!

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React, { Component, PropTypes } from "react";
import moment from "moment";
import { Icon } from "/imports/plugins/core/ui/client/components";
import { i18next } from "/client/api";

class EmailTableColumn extends Component {
static propTypes = {
data: PropTypes.object,
data: PropTypes.oneOfType([
PropTypes.string,
PropTypes.instanceOf(Date)
]),
metadata: PropTypes.object,
rowData: PropTypes.object
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,15 @@ describe("braintree/refund/create", function () {
sandbox.stub(BraintreeApi.apiCall, "createRefund", function () {
return braintreeRefundResult;
});


let refundResult = null;
let refundError = null;


Meteor.call("braintree/refund/create", paymentMethod, paymentMethod.amount, function (error, result) {
refundResult = result;
refundError = error;
expect(refundError).to.be.undefined;
expect(refundResult).to.not.be.undefined;
expect(refundResult.saved).to.be.true;
return done();
});


expect(refundError).to.be.undefined;
expect(refundResult).to.not.be.undefined;
expect(refundResult.saved).to.be.true;
done();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,15 @@ describe("payflowpro/refund/create", function () {
sandbox.stub(PayflowproApi.apiCall, "createRefund", function () {
return payflowproRefundResult;
});


let refundResult = null;
let refundError = null;


Meteor.call("payflowpro/refund/create", paymentMethod, paymentMethod.amount, function (error, result) {
refundResult = result;
refundError = error;
expect(refundError).to.be.undefined;
expect(refundResult).to.not.be.undefined;
expect(refundResult.saved).to.be.true;
done();
});


expect(refundError).to.be.undefined;
expect(refundResult).to.not.be.undefined;
expect(refundResult.saved).to.be.true;
// expect(BraintreeApi.apiCall.createRefund).to.have.been.calledWith({
// createRefund: {
// amount: 99.95,
// transactionId: paymentMethod.transactionId
// }
// });
done();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,17 @@ describe("stripe/payment/capture", function () {
Meteor.call("stripe/payment/capture", paymentMethod, function (error, result) {
captureResult = result;
captureError = error;
expect(captureError).to.be.undefined;
expect(captureResult).to.not.be.undefined;
expect(captureResult.saved).to.be.true;
expect(StripeApi.methods.captureCharge.call).to.have.been.calledWith({
transactionId: paymentMethod.transactionId,
captureDetails: {
amount: 1999
}
});
done();
});

expect(captureError).to.be.undefined;
expect(captureResult).to.not.be.undefined;
expect(captureResult.saved).to.be.true;
expect(StripeApi.methods.captureCharge.call).to.have.been.calledWith({
transactionId: paymentMethod.transactionId,
captureDetails: {
amount: 1999
}
});
done();
});
});

Expand Down Expand Up @@ -144,11 +143,10 @@ describe("stripe/payment/capture", function () {
Meteor.call("stripe/payment/capture", paymentMethod, function (error, result) {
captureResult = result;
captureError = error;
expect(captureError.message).to.equal("Match error: Match error: Transaction id is required");
expect(captureResult).to.be.undefined;
done();
});

expect(captureError.message).to.equal("Match error: Match error: Transaction id is required");
expect(captureResult).to.be.undefined;
done();
});
});

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("Stripe.authorize", function () {
sandbox.restore();
});

it("should call StripeApi.methods.createCharge with the proper parameters and return saved = true", function () {
it("should call StripeApi.methods.createCharge with the proper parameters and return saved = true", function (done) {
sandbox.stub(StripeApi.methods.createCharge, "call", function () {
return stripeChargeResult;
});
Expand All @@ -72,9 +72,10 @@ describe("Stripe.authorize", function () {
let chargeResult = null;
Stripe.authorize(cardData, { total: total, currency: currency }, function (error, result) {
chargeResult = result;
expect(chargeResult).to.not.be.undefined;
expect(chargeResult.saved).to.be.true;
done();
});
expect(chargeResult).to.not.be.undefined;
expect(chargeResult.saved).to.be.true;
});
});

Expand All @@ -89,7 +90,7 @@ describe("Stripe.authorize", function () {
sandbox.restore();
});

it("should properly charge a card when using a currency besides USD", function () {
it("should properly charge a card when using a currency besides USD", function (done) {
const form = {
cvv2: "345",
expire_month: "4",
Expand All @@ -108,22 +109,22 @@ describe("Stripe.authorize", function () {
let chargeResult = null;
Stripe.authorize(form, { total: total, currency: currency }, function (error, result) {
chargeResult = result;
});

expect(chargeResult).to.not.be.undefined;
expect(chargeResult.saved).to.be.true;
expect(StripeApi.methods.createCharge.call).to.have.been.calledWith({
chargeObj: {
amount: 2298,
currency: "EUR",
card: {
number: "4242424242424242",
name: "Test User",
cvc: "345",
exp_month: "4",
exp_year: "2019"
}, capture: false
}
expect(chargeResult).to.not.be.undefined;
expect(chargeResult.saved).to.be.true;
expect(StripeApi.methods.createCharge.call).to.have.been.calledWith({
chargeObj: {
amount: 2298,
currency: "EUR",
card: {
number: "4242424242424242",
name: "Test User",
cvc: "345",
exp_month: "4",
exp_year: "2019"
}, capture: false
}
});
done();
});
});
});
Expand All @@ -139,7 +140,7 @@ describe("Stripe.authorize", function () {
sandbox.restore();
});

it("should return saved = false when card is declined", function () {
it("should return saved = false when card is declined", function (done) {
const form = {
cvv2: "345",
expire_month: "4",
Expand Down Expand Up @@ -181,23 +182,24 @@ describe("Stripe.authorize", function () {
let chargeResult = null;
Stripe.authorize(form, { total: total, currency: currency }, function (error, result) {
chargeResult = result;
});

expect(chargeResult).to.not.be.undefined;
expect(chargeResult.saved).to.be.false;
expect(chargeResult.error).to.equal("Your card was declined.");
expect(StripeApi.methods.createCharge.call).to.have.been.calledWith({
chargeObj: {
amount: 2298,
currency: "EUR",
card: {
number: "4000000000000002",
name: "Test User",
cvc: "345",
exp_month: "4",
exp_year: "2019"
}, capture: false
}
expect(chargeResult).to.not.be.undefined;
expect(chargeResult.saved).to.be.false;
expect(chargeResult.error).to.equal("Your card was declined.");
expect(StripeApi.methods.createCharge.call).to.have.been.calledWith({
chargeObj: {
amount: 2298,
currency: "EUR",
card: {
number: "4000000000000002",
name: "Test User",
cvc: "345",
exp_month: "4",
exp_year: "2019"
}, capture: false
}
});
done();
});
});
});
Expand All @@ -213,7 +215,7 @@ describe("Stripe.authorize", function () {
sandbox.restore();
});

it("should return saved = false when an expired card is returned", function () {
it("should return saved = false when an expired card is returned", function (done) {
// Note that this test number makes the Stripe API return this error, it is
// not looking at the actual expiration date.
const form = {
Expand Down Expand Up @@ -252,28 +254,27 @@ describe("Stripe.authorize", function () {
sandbox.stub(StripeApi.methods.createCharge, "call", function () {
return stripeExpiredCardResult;
});
// spyOn(StripeApi.methods.createCharge, "call").and.returnValue(stripeExpiredCardResult);

let chargeResult = null;
Stripe.authorize(form, { total: total, currency: currency }, function (error, result) {
chargeResult = result;
});

expect(chargeResult).to.not.be.undefined;
expect(chargeResult.saved).to.be.false;
expect(chargeResult.error).to.equal("Your card has expired.");
expect(StripeApi.methods.createCharge.call).to.have.been.calledWith({
chargeObj: {
amount: 2298,
currency: "USD",
card: {
number: "4000000000000069",
name: "Test User",
cvc: "345",
exp_month: "4",
exp_year: "2019"
}, capture: false
}
expect(chargeResult).to.not.be.undefined;
expect(chargeResult.saved).to.be.false;
expect(chargeResult.error).to.equal("Your card has expired.");
expect(StripeApi.methods.createCharge.call).to.have.been.calledWith({
chargeObj: {
amount: 2298,
currency: "USD",
card: {
number: "4000000000000069",
name: "Test User",
cvc: "345",
exp_month: "4",
exp_year: "2019"
}, capture: false
}
});
done();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,18 @@ describe("stripe/refund/create", function () {
Meteor.call("stripe/refund/create", paymentMethod, paymentMethod.amount, function (error, result) {
refundResult = result;
refundError = error;
expect(refundError).to.be.undefined;
expect(refundResult).to.not.be.undefined;
expect(refundResult.saved).to.be.true;
expect(StripeApi.methods.createRefund.call).to.have.been.calledWith({
refundDetails: {
charge: paymentMethod.transactionId,
amount: 1999,
reason: "requested_by_customer"
}
});
done();
});

expect(refundError).to.be.undefined;
expect(refundResult).to.not.be.undefined;
expect(refundResult.saved).to.be.true;
expect(StripeApi.methods.createRefund.call).to.have.been.calledWith({
refundDetails: {
charge: paymentMethod.transactionId,
amount: 1999,
reason: "requested_by_customer"
}
});
done();
});
});

Loading

0 comments on commit 1a195a8

Please sign in to comment.