DEV: upgrades from Ember 2.13 to Ember 3.5.1 (#6808)

Co-Authored-By: Bianca Nenciu <nbianca@users.noreply.github.com>
Co-Authored-By: David Taylor <david@taylorhq.com>
This commit is contained in:
Joffrey JAFFEUX
2019-01-10 11:06:01 +01:00
committed by GitHub
parent 7896c74c2b
commit f9648de897
318 changed files with 1684 additions and 1462 deletions

View File

@ -73,7 +73,7 @@ Object.keys(pathBindings).forEach(path => {
var testName = binding + " goes to " + path;
test(testName, function(assert) {
KeyboardShortcuts.bindEvents(testMouseTrap);
KeyboardShortcuts.bindEvents(testMouseTrap, Discourse.__container__);
testMouseTrap.trigger(binding);
assert.ok(DiscourseURL.routeTo.calledWith(path));
@ -88,7 +88,7 @@ Object.keys(clickBindings).forEach(selector => {
var testName = binding + " clicks on " + selector;
test(testName, function(assert) {
KeyboardShortcuts.bindEvents(testMouseTrap);
KeyboardShortcuts.bindEvents(testMouseTrap, Discourse.__container__);
$(selector).on("click", function() {
assert.ok(true, selector + " was clicked");
});
@ -108,24 +108,24 @@ Object.keys(functionBindings).forEach(func => {
sandbox.stub(KeyboardShortcuts, func, function() {
assert.ok(true, func + " is called when " + binding + " is triggered");
});
KeyboardShortcuts.bindEvents(testMouseTrap);
KeyboardShortcuts.bindEvents(testMouseTrap, Discourse.__container__);
testMouseTrap.trigger(binding);
});
});
QUnit.test("selectDown calls _moveSelection with 1", assert => {
var spy = sandbox.spy(KeyboardShortcuts, "_moveSelection");
var stub = sandbox.stub(KeyboardShortcuts, "_moveSelection");
KeyboardShortcuts.selectDown();
assert.ok(spy.calledWith(1), "_moveSelection is called with 1");
assert.ok(stub.calledWith(1), "_moveSelection is called with 1");
});
QUnit.test("selectUp calls _moveSelection with -1", assert => {
var spy = sandbox.spy(KeyboardShortcuts, "_moveSelection");
var stub = sandbox.stub(KeyboardShortcuts, "_moveSelection");
KeyboardShortcuts.selectUp();
assert.ok(spy.calledWith(-1), "_moveSelection is called with -1");
assert.ok(stub.calledWith(-1), "_moveSelection is called with -1");
});
QUnit.test("goBack calls history.back", assert => {