mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
Don't scroll to top on transition in tests
It's mega annoying
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -10,4 +10,5 @@ export default Service.extend({
|
||||
|
||||
isDev: computed.equal('environment', 'development'),
|
||||
isProd: computed.equal('environment', 'production'),
|
||||
isTest: computed.equal('environment', 'test'),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user