Don't scroll to top on transition in tests

It's mega annoying
This commit is contained in:
Michael Lange
2017-10-23 10:21:44 -07:00
parent d5b8cfff59
commit 8bece2f89a
2 changed files with 7 additions and 2 deletions

View File

@@ -1,8 +1,10 @@
import Ember from 'ember';
const { Route } = Ember;
const { Route, inject } = Ember;
export default Route.extend({
config: inject.service(),
resetController(controller, isExiting) {
if (isExiting) {
controller.set('error', null);
@@ -11,7 +13,9 @@ export default Route.extend({
actions: {
didTransition() {
window.scrollTo(0, 0);
if (!this.get('config.isTest')) {
window.scrollTo(0, 0);
}
},
willTransition() {

View File

@@ -10,4 +10,5 @@ export default Service.extend({
isDev: computed.equal('environment', 'development'),
isProd: computed.equal('environment', 'production'),
isTest: computed.equal('environment', 'test'),
});