3
3
describe('application hotkeys', function() {
4
var app, container, windowNode, Y;
4
var app, container, env, windowNode, Y;
6
6
before(function(done) {
7
7
Y = YUI(GlobalConfig).use(
8
8
['juju-gui', 'juju-tests-utils', 'node-event-simulate'], function(Y) {
10
10
after: function() {},
11
11
get: function() {},
15
15
windowNode = Y.one(window);
16
app = new Y.juju.App({
19
viewContainer: container
21
app.showView(new Y.View());
22
app.activateHotkeys();
28
21
beforeEach(function() {
29
container = Y.Node.create('<div/>');
22
container = Y.namespace('juju-tests.utils').makeContainer();
23
app = new Y.juju.App({
26
viewContainer: container
28
app.showView(new Y.View());
29
app.activateHotkeys();
30
31
Y.one('#main').append(container);
34
35
afterEach(function() {
35
36
container.remove(true);
38
it('should listen for alt-S events', function() {
37
app.destroy({remove: true});
40
it('should listen for "?" events', function() {
41
windowNode.simulate('keydown', {
42
keyCode: 191, // "/" key.
45
var help = Y.one('#shortcut-help');
46
assert.equal(help.getStyle('display'), 'block');
49
it('should listen for Alt-S key events', function() {
39
50
var searchInput = Y.Node.create('<input/>');
40
51
searchInput.set('id', 'charm-search-field');
41
52
container.append(searchInput);