diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js index b6600dd..6cbbe63 100644 --- a/tests/dummy/config/environment.js +++ b/tests/dummy/config/environment.js @@ -49,7 +49,7 @@ module.exports = function(environment) { } if (environment === 'production') { - + // production config } return ENV; diff --git a/tests/integration/components/stripe-card-cvc-test.js b/tests/integration/components/stripe-card-cvc-test.js index f792e87..475e246 100644 --- a/tests/integration/components/stripe-card-cvc-test.js +++ b/tests/integration/components/stripe-card-cvc-test.js @@ -1,12 +1,12 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; -import { render } from '@ember/test-helpers'; +import { render, find } from '@ember/test-helpers'; import StripeMock from 'ember-stripe-elements/utils/stripe-mock'; import env from 'dummy/config/environment'; import StripeService from 'dummy/services/stripev3'; -module('Integration | Component | stripe card cvc', function(hooks) { +module('Integration | Component | stripe-card-cvc', function(hooks) { setupRenderingTest(hooks); hooks.beforeEach(function() { @@ -23,9 +23,10 @@ module('Integration | Component | stripe card cvc', function(hooks) { ); }); - test('it renders', async function(assert) { + test('it renders', async function (assert) { await render(hbs`{{stripe-card-cvc}}`); - assert.equal(this.element.textContent.trim(), ''); + assert.ok(find('.ember-stripe-element.ember-stripe-card-cvc')); + assert.ok(find('[role="mount-point"]')); }); }); diff --git a/tests/integration/components/stripe-card-expiry-test.js b/tests/integration/components/stripe-card-expiry-test.js index cbc0f8d..040da80 100644 --- a/tests/integration/components/stripe-card-expiry-test.js +++ b/tests/integration/components/stripe-card-expiry-test.js @@ -1,12 +1,12 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; -import { render } from '@ember/test-helpers'; +import { render, find } from '@ember/test-helpers'; import StripeMock from 'ember-stripe-elements/utils/stripe-mock'; import env from 'dummy/config/environment'; import StripeService from 'dummy/services/stripev3'; -module('Integration | Component | stripe card expiry', function(hooks) { +module('Integration | Component | stripe-card-expiry', function(hooks) { setupRenderingTest(hooks); hooks.beforeEach(function() { @@ -26,6 +26,7 @@ module('Integration | Component | stripe card expiry', function(hooks) { test('it renders', async function(assert) { await render(hbs`{{stripe-card-expiry}}`); - assert.equal(this.element.textContent.trim(), ''); + assert.ok(find('.ember-stripe-element.ember-stripe-card-expiry')); + assert.ok(find('[role="mount-point"]')); }); }); diff --git a/tests/integration/components/stripe-card-number-test.js b/tests/integration/components/stripe-card-number-test.js index fc479d2..b3eb728 100644 --- a/tests/integration/components/stripe-card-number-test.js +++ b/tests/integration/components/stripe-card-number-test.js @@ -1,7 +1,7 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; -import { render } from '@ember/test-helpers'; +import { render, find } from '@ember/test-helpers'; import StripeMock from 'ember-stripe-elements/utils/stripe-mock'; import env from 'dummy/config/environment'; import StripeService from 'dummy/services/stripev3'; @@ -26,7 +26,7 @@ module('Integration | Component | stripe card number', function(hooks) { test('it renders', async function(assert) { await render(hbs`{{stripe-card-number}}`); - assert.equal(this.element.textContent.trim(), ''); + assert.ok(find('.ember-stripe-element.ember-stripe-card-number')); + assert.ok(find('[role="mount-point"]')); }); }); - diff --git a/tests/integration/components/stripe-card-test.js b/tests/integration/components/stripe-card-test.js index cd432b4..98ee2d2 100644 --- a/tests/integration/components/stripe-card-test.js +++ b/tests/integration/components/stripe-card-test.js @@ -1,12 +1,12 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; -import { render } from '@ember/test-helpers'; +import { render, find } from '@ember/test-helpers'; import StripeMock from 'ember-stripe-elements/utils/stripe-mock'; import env from 'dummy/config/environment'; import StripeService from 'dummy/services/stripev3'; -module('Integration | Component | stripe card', function(hooks) { +module('Integration | Component | stripe-card', function(hooks) { setupRenderingTest(hooks); hooks.beforeEach(function() { @@ -24,14 +24,10 @@ module('Integration | Component | stripe card', function(hooks) { }); test('it renders', async function(assert) { - // Template block usage: - await render(hbs` - {{#stripe-card}} - template block text - {{/stripe-card}} - `); + await render(hbs`{{stripe-card}}`); - assert.equal(this.element.textContent.trim(), 'template block text'); + assert.ok(find('.ember-stripe-element.ember-stripe-card')); + assert.ok(find('[role="mount-point"]')); }); test('yields out error message', async function(assert) { diff --git a/tests/integration/components/stripe-postal-code-test.js b/tests/integration/components/stripe-postal-code-test.js index 4d6cee6..f108c19 100644 --- a/tests/integration/components/stripe-postal-code-test.js +++ b/tests/integration/components/stripe-postal-code-test.js @@ -1,12 +1,12 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; -import { render } from '@ember/test-helpers'; +import { render, find } from '@ember/test-helpers'; import StripeMock from 'ember-stripe-elements/utils/stripe-mock'; import env from 'dummy/config/environment'; import StripeService from 'dummy/services/stripev3'; -module('Integration | Component | stripe postal code', function(hooks) { +module('Integration | Component | stripe-postal-code', function(hooks) { setupRenderingTest(hooks); hooks.beforeEach(function() { @@ -26,6 +26,7 @@ module('Integration | Component | stripe postal code', function(hooks) { test('it renders', async function(assert) { await render(hbs`{{stripe-postal-code}}`); - assert.equal(this.element.textContent.trim(), ''); + assert.ok(find('.ember-stripe-element.ember-stripe-postal-code')); + assert.ok(find('[role="mount-point"]')); }); });