Skip to content

Commit

Permalink
Framework: update test to check use moment query (#8698)
Browse files Browse the repository at this point in the history
  • Loading branch information
gwwar authored Oct 13, 2016
1 parent 185e99a commit 7a5f934
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions client/lib/purchases/test/assembler.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe( 'assembler', () => {
} );

it( 'should convert the payment credit card data to the right data structure', () => {
expect( createPurchasesArray( [ {
const purchase = createPurchasesArray( [ {
payment_card_id: 1234,
payment_card_type: 'visa',
payment_details: 7890,
Expand All @@ -32,18 +32,17 @@ describe( 'assembler', () => {
payment_name: 'My VISA',
payment_country_code: 'US',
payment_country_name: 'United States'
} ] ) ).to.have.deep.property( '[0].payment' ).that.deep.equals( {
creditCard: {
expiryDate: '11/16',
expiryMoment: moment( '11/16', 'MM/YY' ),
id: 1234,
number: 7890,
type: 'visa'
},
type: 'credit_card',
countryCode: 'US',
countryName: 'United States',
name: 'My VISA'
} );
} ] );
const payment = purchase[ 0 ].payment;
const creditCard = payment.creditCard;
expect( creditCard.expiryDate ).to.equal( '11/16' );
expect( creditCard.expiryMoment.isSame( moment( '11/16', 'MM/YY' ) ) ).to.equal( true );
expect( creditCard.id ).to.equal( 1234 );
expect( creditCard.number ).to.equal( 7890 );
expect( creditCard.type ).to.equal( 'visa' );
expect( payment.type ).to.equal( 'credit_card' );
expect( payment.countryCode ).to.equal( 'US' );
expect( payment.countryName ).to.equal( 'United States' );
expect( payment.name ).to.equal( 'My VISA' );
} );
} );

0 comments on commit 7a5f934

Please sign in to comment.