mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
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:
@ -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 => {
|
||||
|
Reference in New Issue
Block a user