]>
git.proxmox.com Git - extjs.git/blob - extjs/classic/classic/test/specs/app/domain/Component.js
1 describe("Ext.app.domain.Component", function() {
4 beforeEach(function() {
5 panel
= new Ext
.panel
.Panel({
6 renderTo
: Ext
.getBody(),
12 ctrl
= new Ext
.app
.Controller({
17 afterEach(function() {
21 it("should ignore case on event names", function() {
22 var handler
= jasmine
.createSpy('foo handler');
30 panel
.fireEvent('FOO');
32 expect(handler
).toHaveBeenCalled();
35 it("controls Component events with control() method", function() {
36 var handler
= jasmine
.createSpy('foo handler');
44 panel
.fireEvent('foo');
46 expect(handler
).toHaveBeenCalled();
49 it("listens to Component events with listen() method", function() {
50 var handler
= jasmine
.createSpy('bar handler');
60 panel
.fireEvent('bar');
62 expect(handler
).toHaveBeenCalled();
65 describe('looking up a menu as the direct child of a menu item', function () {
68 beforeEach(function () {
69 handler
= jasmine
.createSpy('foo handler');
71 menu
= new Ext
.menu
.Menu({
75 menu
: new Ext
.menu
.Menu({
82 renderTo
: Ext
.getBody()
86 afterEach(function () {
88 handler
= menu
= null;
91 it('should find the owner of the menu as a descendant of the menu item', function () {
98 Ext
.getCmp('childMenu').fireEvent('foo');
100 expect(handler
).toHaveBeenCalled();
103 it('should find the owner of the menu as a direct child of the menu item', function () {
110 Ext
.getCmp('childMenu').fireEvent('foo');
112 expect(handler
).toHaveBeenCalled();