{"size": 545, "ext": "js", "max_stars_repo_path": "tests/unit/mixins/reset-scroll-test.js", "max_stars_repo_name": "laurenbarker/ember-osf-preprints", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "tests/unit/mixins/reset-scroll-test.js", "max_issues_repo_name": "laurenbarker/ember-osf-preprints", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "tests/unit/mixins/reset-scroll-test.js", "max_forks_repo_name": "laurenbarker/ember-osf-preprints", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.6842105263, "max_line_length": 92, "alphanum_fraction": 0.6660550459}
import Ember from 'ember';
import ResetScrollMixin from 'preprint-service/mixins/reset-scroll';
import { module, test } from 'qunit';

module('Unit | Mixin | reset scroll');

test('ResetScrollMixin mixin scrolls back to the top on every new route', function(assert) {
    const object = Ember.Object.extend(ResetScrollMixin).create();

    object.set('scrollTarget', {
        scrollTo() {
            return [...arguments];
        }
    });

    assert.ok(ResetScrollMixin.detect(object));
    assert.deepEqual(object.activate(), [0, 0]);
});
