Last active
June 29, 2016 17:26
-
-
Save dfreeman/6f7689d10ec6877e484f9f0a0ab2b842 to your computer and use it in GitHub Desktop.
Page Object Failure
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'; | |
import { create, collection, text } from 'ember-cli-page-object'; | |
moduleForComponent('my-component', { integration: true }); | |
const itemCollection = { | |
itemScope: '.item', | |
item: { | |
label: text() | |
} | |
}; | |
test('it renders', function(assert) { | |
// This assertion passes on 1.4.0 and 1.4.1 | |
assert.equal(itemCollection.itemScope, '.item'); | |
// This object works correctly | |
const left = create({ | |
scope: '.left', | |
items: collection(itemCollection) | |
}).setContext(this); | |
// This object doesn't work, because `item` and `itemScope` are missing | |
const right = create({ | |
scope: '.right', | |
items: collection(itemCollection) | |
}).setContext(this); | |
this.render(hbs`{{my-component}}`); | |
assert.deepEqual(left.items().mapBy('text'), ['one', 'two', 'three']); | |
assert.deepEqual(right.items().mapBy('text'), ['one', 'two', 'three']); | |
// This assertion (same as the first) passes on 1.4.0 and fails on 1.4.1 | |
assert.equal(itemCollection.itemScope, '.item'); | |
}); |
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.10.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.6.0", | |
"ember-data": "2.6.1", | |
"ember-template-compiler": "2.6.0" | |
}, | |
"addons": { | |
"ember-cli-page-object": "1.4.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment