]>
git.proxmox.com Git - extjs.git/blob - extjs/classic/classic/test/specs/menu/DatePicker.js
1 describe("Ext.menu.DatePicker", function() {
2 var expectFocused
= jasmine
.expectFocused
,
3 pressKey
= jasmine
.asyncPressKey
,
6 function makeMenu(cfg
) {
11 menu
= new Ext
.menu
.DatePicker(cfg
);
16 afterEach(function() {
24 describe("pickerCfg", function() {
25 beforeEach(function() {
35 it("should apply pickerCfg", function() {
36 expect(menu
.picker
.foo
).toBe('bar');
39 it("should not apply other configs", function() {
40 expect(menu
.picker
.blerg
).not
.toBeDefined();
44 describe("no pickerCfg", function() {
45 it("should apply config", function() {
50 expect(menu
.picker
.frobbe
).toBe('gurgle');
54 describe("keyboard interaction", function() {
57 beforeEach(function() {
58 button
= new Ext
.button
.Button({
59 renderTo
: Ext
.getBody(),
73 dateItem
= button
.menu
.down('[text=date]');
76 dateItem
.expandMenu(null, 0);
81 afterEach(function() {
89 it("should focus the picker eventEl on open", function() {
90 expectFocused(menu
.picker
.eventEl
, false);
93 it("should close the date menu on Esc key", function() {
94 pressKey(menu
.picker
.eventEl
, 'esc');
97 return !menu
.isVisible();
98 }, 'Date menu to hide', 1000);
101 expect(menu
.isVisible()).toBeFalsy();
105 it("should focus the owner menu item on Esc key", function() {
106 pressKey(menu
.picker
.eventEl
, 'esc');
108 expectFocused(dateItem
);