Skip to content

Commit

Permalink
update credit-card integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Batson committed Nov 13, 2016
1 parent f504e76 commit 3e90c9f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/integration/components/donation/credit-card-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import PageObject from 'ember-cli-page-object';
import stubService from 'code-corps-ember/tests/helpers/stub-service';
import setHandler from 'code-corps-ember/tests/helpers/set-handler';
import creditCardComponent from '../../../pages/components/donation/credit-card';
import Ember from 'ember';

const { RSVP: { Promise }} = Ember;

let page = PageObject.create(creditCardComponent);

Expand All @@ -19,7 +22,7 @@ moduleForComponent('donation/credit-card', 'Integration | Component | donation/c
});

test('it sends submit with credit card fields when button is clicked', function(assert) {
assert.expect(2);
assert.expect(1);

this.set('canDonate', true);

Expand All @@ -32,6 +35,7 @@ test('it sends submit with credit card fields when button is clicked', function(

let submitHandler = function(actualProps) {
assert.deepEqual(actualProps, expectedProps, 'Action was called with proper attributes.');
return Promise.resolve();
};

setHandler(this, 'submit', submitHandler);
Expand All @@ -50,6 +54,4 @@ test('it sends submit with credit card fields when button is clicked', function(
.cardYear(expectedProps.year)
.cardCVC(expectedProps.cvc)
.clickSubmit();

assert.ok(page.submitDisabled, 'Submit button got disabled.');
});

0 comments on commit 3e90c9f

Please sign in to comment.