Skip to content

Instantly share code, notes, and snippets.

@ykaragol
Created May 23, 2017 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ykaragol/89c9d9dfa358031b3ee8e434d3170c99 to your computer and use it in GitHub Desktop.
Save ykaragol/89c9d9dfa358031b3ee8e434d3170c99 to your computer and use it in GitHub Desktop.
ember-tether remove with isShowing error
import Ember from 'ember';
export default Ember.Component.extend({
isShowing:false,
actions:{
clicked(){
this.toggleProperty('isShowing');
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<br><br>
<div id="a-nice-person">
Nice person
</div>
<div class="ember-view">
<!-- rest of your Ember app's DOM... -->
</div>
{{#if isShowing}}
{{#ember-tether
target='#a-nice-person'
targetAttachment='top left'
attachment='bottom left'
}}
<div id="my-puppy">
A puppy
</div>
{{/ember-tether}}
{{/if}}
<button onclick={{action 'clicked'}}>Button</button>
import Ember from 'ember';
export default function destroyApp(application) {
Ember.run(application, 'destroy');
}
import Resolver from '../../resolver';
import config from '../../config/environment';
const resolver = Resolver.create();
resolver.namespace = {
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix
};
export default resolver;
import Ember from 'ember';
import Application from '../../app';
import config from '../../config/environment';
const { run } = Ember;
const assign = Ember.assign || Ember.merge;
export default function startApp(attrs) {
let application;
let attributes = assign({rootElement: "#test-root"}, config.APP);
attributes = assign(attributes, attrs); // use defaults, but you can override;
run(() => {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
});
return application;
}
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) {
// Template block usage:
this.render(hbs`
{{#my-component}}
template block text
{{/my-component}}
`);
assert.equal(this.$('#a-nice-person').text().trim(), 'Nice person');
assert.equal(Ember.$('#my-puppy').length, 0);
this.$('button').click();
assert.equal(Ember.$('#my-puppy').text().trim(), 'A puppy');
this.$('button').click();
assert.equal(Ember.$('#my-puppy').length, 0);
});
import resolver from './helpers/resolver';
import {
setResolver
} from 'ember-qunit';
setResolver(resolver);
{
"version": "0.12.1",
"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.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-tether": "0.4.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment