This file contains 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'; | |
const { computed } = Ember; | |
function comp() { | |
const args = Array.from(arguments); | |
const cb = args.pop(); | |
const keys = args.slice(); | |
args.push(function(key) { |
This file contains 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 { WatchedPolly } from '@pollyjs/core-ui'; | |
import { setupMocha as setupPolly } from '@pollyjs/core'; | |
describe('acceptance | homepage', function() { | |
setupPolly({ expiresIn: '30 days' }, WatchedPolly); | |
it('menu renders', function() { | |
await visit('index'); | |
await expect(homepage.menu).to.exist(); | |
}); |
This file contains 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({ | |
tagName: 'td', | |
row: null, | |
column: null, | |
register() {}, | |
init() { | |
this._super(); | |
this.register(this); |
This file contains 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 '../custom-element'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
count: 0, | |
actions: { | |
handleCounterClick() { | |
this.incrementProperty('count'); | |
} |
This file contains 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
let updatedName = false; | |
let newName = 'Tom'; | |
const spy = new Spy('test-create-user-form'); | |
/* TODO: ability to override auth header when recording. use case: test account to read from api */ | |
await visit('/signup'); | |
except(signup.name.value).to.equal('Yehuda'); | |
await signup.name.value(newName); |
This file contains 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 { task, timeout } from 'ember-concurrency'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
logs: Ember.computed(function() { | |
return Ember.A(); | |
}), | |
doWork: task(function*() { | |
console.log(arguments); |
This file contains 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'; | |
const { set, computed, Controller, A:emberArray } = Ember; | |
const { filterBy } = computed; | |
const Model = Ember.Object.extend({ | |
id: null, | |
isActive: true, | |
name: '<unknown>', | |
unloadRecord() { |
This file contains 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
function imageSize(blobString) { | |
return new Promise((resolve, reject) => { | |
let img = new Image(); | |
img.onload = (err) => resolve({ width: img.naturalWidth, height: img.naturalHeight }); | |
img.onerror = (err) => reject(err); | |
img.src = blobString; | |
}); | |
} |
This file contains 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({ | |
hasBlock: false | |
}); |