Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #45

Merged
merged 3 commits into from
Jan 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "ember-form-master-2000",
"dependencies": {
"ember": "^2.1.0",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-shims": "0.1.0",
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
"ember-data": "^2.1.0",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5",
"ember-qunit": "0.4.9",
"ember-qunit-notifications": "0.0.7",
"ember-resolver": "~0.1.18",
"jquery": "^1.11.3",
"jquery": "1.11.3",
"loader.js": "ember-cli/loader.js#3.2.1",
"qunit": "~1.18.0"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/components/fm-checkbox-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ moduleForComponent('fm-checkbox', 'Integration | Component | fm-checkbox', {
// assert.equal(this.$('label').text().trim(), 'This is the label', 'the fm-checkbox label matches');
// });

test('errors are shown after user interaction but not before', function(assert) {
test('errors are shown after user interaction but not before if fmConfig.showErrorsByDefault is false', function(assert) {
this.set('errors', ['error message']);
this.render(hbs `{{fm-checkbox errors=errors}}`);
assert.ok(
Expand Down
14 changes: 10 additions & 4 deletions tests/integration/components/fm-field-test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { moduleForComponent, test } from 'ember-qunit';
import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';
import fmConfig from 'ember-form-master-2000/services/fm-config';
// import {initialize} from 'ember-form-master-2000/initializers/fm-initialize';

moduleForComponent('fm-field', 'Integration | Component | fm-field', {
integration: true,
setup: function() {
this.container.inject = this.container.injection;
// this.container.inject = this.container.injection;
// initialize(null, this.container);
this.register('service:fm-config', fmConfig);
this.inject.service('fm-config', { as: 'config'});
}
});

Expand Down Expand Up @@ -97,7 +100,8 @@ test('selection option label is updated when property changes', function(assert)
assert.equal(this.$('option').text().trim(), 'bar');
});

test('errors are not shown after user interaction but not before', function(assert) {
test('errors are shown after user interaction but not before', function(assert) {
this.set('config.showErrorsByDefault', false);
this.set('errors', ['error message']);
this.render(hbs `{{fm-field errors=errors}}`);
assert.ok(
Expand All @@ -124,7 +128,8 @@ test('errors are not shown after user interaction but not before', function(asse
);
});

test('errors are not shown after user interaction but not before (textarea)', function(assert) {
test('errors are shown after user interaction but not before (textarea)', function(assert) {
this.set('config.showErrorsByDefault', false);
this.set('errors', ['error message']);
this.render(hbs `{{fm-field type='textarea' errors=errors}}`);
assert.ok(
Expand All @@ -151,7 +156,8 @@ test('errors are not shown after user interaction but not before (textarea)', fu
);
});

test('errors are not shown after user interaction but not before (select)', function(assert) {
test('errors are shown after user interaction but not before (select)', function(assert) {
this.set('config.showErrorsByDefault', false);
this.set('errors', ['error message']);
this.render(hbs `{{fm-field type='select' errors=errors}}`);
assert.ok(
Expand Down
8 changes: 6 additions & 2 deletions tests/integration/components/fm-form-test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import fmConfig from 'ember-form-master-2000/services/fm-config';
// import {initialize} from 'ember-form-master-2000/initializers/fm-initialize';
//
moduleForComponent('fm-form', 'Integration | Component | fm-form', {
integration: true,
// setup: function() {
setup: function() {
this.register('service:fm-config', fmConfig);
this.inject.service('fm-config', { as: 'config' });
// this.container.inject = this.container.injection;
// initialize(null, this.container);
// }
}
});
//
// test('renders properly', function(assert) {
Expand All @@ -24,6 +27,7 @@ moduleForComponent('fm-form', 'Integration | Component | fm-form', {
// });

test('form shows errors on submit', function(assert) {
this.set('config.showErrorsByDefault', false);
this.set('errors', ['error message']);
this.render(hbs `
{{#fm-form}}
Expand Down