Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simonihmig committed Sep 4, 2020
1 parent 2ae6dc8 commit 45eb445
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tests/integration/components/bs-form-element-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import ObjectProxy from '@ember/object/proxy';
import { setOwner } from '@ember/application';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, find, triggerEvent } from '@ember/test-helpers';
import { render, triggerEvent } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { validator, buildValidations } from 'ember-cp-validations';
import { buildValidations, validator } from 'ember-cp-validations';

const Validations = buildValidations({
test: [
Expand Down Expand Up @@ -37,9 +37,9 @@ module('Integration | Component | bs form element', function(hooks) {
};

await render(hbs`
{{#bs-form model=model onSubmit=(action submitAction) onInvalid=(action invalidAction) as |form|}}
{{form.element label="test" property="test"}}
{{/bs-form}}
<BsForm @model={{this.model}} @onSubmit={{this.submitAction}} @onInvalid={{this.invalidAction}} as |form|>
<form.element @label="test" @property="test" />
</BsForm>
`);

assert.expect(1);
Expand All @@ -60,15 +60,15 @@ module('Integration | Component | bs form element', function(hooks) {
};

await render(hbs`
{{#bs-form model=model onSubmit=(action submitAction) onInvalid=(action invalidAction) as |form|}}
{{form.element label="test" property="test"}}
{{/bs-form}}
<BsForm @model={{this.model}} @onSubmit={{this.submitAction}} @onInvalid={{this.invalidAction}} as |form|>
<form.element @label="test" @property="test" />
</BsForm>
`);

assert.expect(2);

await triggerEvent('form', 'submit');
assert.ok(find('.form-group').classList.contains('has-error'), 'form element group has error class');
assert.dom('input').hasClass('is-invalid', 'input has error class');
});

test('valid validation is supported as expected when working with an ember-buffered-proxy model', async function(assert) {
Expand All @@ -90,10 +90,10 @@ module('Integration | Component | bs form element', function(hooks) {
};

await render(hbs`
{{#bs-form model=model onSubmit=(action submitAction) onInvalid=(action invalidAction) as |form|}}
{{form.element label="test" property="test"}}
{{/bs-form}}
`);
<BsForm @model={{this.model}} @onSubmit={{this.submitAction}} @onInvalid={{this.invalidAction}} as |form|>
<form.element @label="test" @property="test" />
</BsForm>
`);

assert.expect(1);

Expand All @@ -118,10 +118,10 @@ module('Integration | Component | bs form element', function(hooks) {
};

await render(hbs`
{{#bs-form model=model onSubmit=(action submitAction) onInvalid=(action invalidAction) as |form|}}
{{form.element label="test" property="test"}}
{{/bs-form}}
`);
<BsForm @model={{this.model}} @onSubmit={{this.submitAction}} @onInvalid={{this.invalidAction}} as |form|>
<form.element @label="test" @property="test" />
</BsForm>
`);

assert.expect(1);

Expand Down

0 comments on commit 45eb445

Please sign in to comment.