-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure new models are only created if they are not already open in a …
…window (#681)
- Loading branch information
1 parent
bd85035
commit 4ce68c6
Showing
2 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
describe('CpsiMapview.util.EditWindowOpenerMixin', function () { | ||
|
||
Ext.Loader.syncRequire(['CpsiMapview.view.window.MinimizableWindow', 'CpsiMapview.util.EditWindowOpenerMixin']); | ||
|
||
describe('Basics', function () { | ||
it('is defined', function () { | ||
expect(CpsiMapview.util.EditWindowOpenerMixin).not.to.be(undefined); | ||
}); | ||
}); | ||
|
||
describe('Functions', function () { | ||
it('getEditingFormWindow', function () { | ||
|
||
var wt = 'CpsiMapview.view.window.MinimizableWindow'; | ||
var recId = 99; | ||
var rec = { | ||
getId: function () { return recId } | ||
}; | ||
var win = Ext.create(wt, { | ||
viewModel: { | ||
data: { | ||
currentRecord: rec | ||
} | ||
} | ||
}); | ||
var mixin = Ext.create('CpsiMapview.util.EditWindowOpenerMixin'); | ||
var returnedWin = mixin.getEditingFormWindow(rec, wt); | ||
expect(returnedWin.id).to.be(win.id); | ||
}); | ||
}); | ||
}); |