Last active
May 31, 2016 19:10
-
-
Save morhook/6bad579ccbec341a048302c4707fb9d9 to your computer and use it in GitHub Desktop.
test attribute inheritance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import MyComponent from './my-component'; | |
export default MyComponent.extend({ | |
attributeBindings: ['other'], | |
other: 'default value' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
attributeBindings:['title'], | |
title: 'title from parent' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Resolver from '../../resolver'; | |
import config from '../../config/environment'; | |
const resolver = Resolver.create(); | |
resolver.namespace = { | |
modulePrefix: config.modulePrefix, | |
podModulePrefix: config.podModulePrefix | |
}; | |
export default resolver; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { moduleForComponent, test } from 'ember-qunit'; | |
import hbs from 'htmlbars-inline-precompile'; | |
moduleForComponent('my-component-son', 'test SON', { | |
integration: true | |
}); | |
test('it renders', function(assert) { | |
this.render(hbs`{{my-component-son}}`); | |
assert.equal(this.$().text().trim(), ''); | |
// Template block usage: | |
this.render(hbs` | |
{{#my-component-son}} | |
template block text | |
{{/my-component-son}} | |
`); | |
assert.equal(this.$().text().trim(), 'template block text'); | |
}); | |
test('it renders father stuff', function(assert) { | |
this.render(hbs`{{my-component-son title='hola'}}`); | |
assert.equal(this.$().text().trim(), ''); | |
assert.equal(this.$('div').attr('title'), 'hola'); | |
}); | |
test('it renders own attributes', function(assert) { | |
this.render(hbs`{{my-component-son other='hola'}}`); | |
assert.equal(this.$().text().trim(), ''); | |
assert.equal(this.$('div').attr('other'), 'hola'); | |
}); | |
test('it renders both attributes', function(assert) { | |
this.render(hbs`{{my-component-son other='hola' title='hellouu'}}`); | |
assert.equal(this.$().text().trim(), ''); | |
assert.equal(this.$('div').attr('other'), 'hola'); | |
assert.equal(this.$('div').attr('title'), 'hellouu'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { moduleForComponent, test } from 'ember-qunit'; | |
import hbs from 'htmlbars-inline-precompile'; | |
moduleForComponent('my-component', 'TODO: put something here', { | |
integration: true | |
}); | |
test('it renders', function(assert) { | |
this.render(hbs`{{my-component title='hola'}}`); | |
assert.equal(this.$().text().trim(), ''); | |
assert.equal(this.$('div').attr('title'), 'hola'); | |
// Template block usage: | |
this.render(hbs` | |
{{#my-component}} | |
template block text | |
{{/my-component}} | |
`); | |
assert.equal(this.$().text().trim(), 'template block text'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import resolver from './helpers/resolver'; | |
import { | |
setResolver | |
} from 'ember-qunit'; | |
setResolver(resolver); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.8.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": true | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.5.1", | |
"ember-data": "2.5.2", | |
"ember-template-compiler": "2.5.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment