Last active
July 25, 2018 22:42
-
-
Save thousand/aef48ab54a568f38f21de3682ca0c9db to your computer and use it in GitHub Desktop.
setting in integration test
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({ | |
| translatedVal: Ember.computed('someVal', function () { | |
| return this.get('someVal') + ' is awesome'; | |
| }) | |
| }); |
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', 'reflected and computed vales update correctly', { | |
| integration: true | |
| }); | |
| test('it renders', function(assert) { | |
| assert.expect(4) | |
| this.set('appName', 'ember twiddle'); | |
| this.render(hbs`{{my-component someVal=appName}}`); | |
| assert.equal(this.$('.reflected-val').text().trim(), 'ember twiddle', 'init reflected val found'); | |
| assert.equal(this.$('.computed-val').text().trim(), 'ember twiddle is awesome', 'init computed val found'); | |
| this.set('appName', 'your mom'); | |
| assert.equal(this.$('.reflected-val').text().trim(), 'your mom', 'init reflected val found'); | |
| assert.equal(this.$('.computed-val').text().trim(), 'your mom is awesome', 'init computed val found'); | |
| }); |
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'; | |
| import { start } from 'ember-cli-qunit'; | |
| setResolver(resolver); | |
| start(); |
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.15.0", | |
| "EmberENV": { | |
| "FEATURES": {} | |
| }, | |
| "options": { | |
| "use_pods": false, | |
| "enable-testing": true | |
| }, | |
| "dependencies": { | |
| "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
| "ember": "3.2.2", | |
| "ember-template-compiler": "3.2.2", | |
| "ember-testing": "3.2.2" | |
| }, | |
| "addons": { | |
| "ember-data": "3.2.0" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment