Skip to content

Instantly share code, notes, and snippets.

@brian428
Created September 6, 2012 04:13
Show Gist options
  • Save brian428/3651132 to your computer and use it in GitHub Desktop.
Save brian428/3651132 to your computer and use it in GitHub Desktop.
Setup for a more complex spec
describe "The Main Tab Panel...", ->
view = null
viewController = null
# A hidden div where we can add UI components to test them and their dependencies.
createComponentTestArea = ->
if Ext.get( "componentTestArea" )? then Ext.removeNode( Ext.get( "componentTestArea" ).dom )
Ext.DomHelper.append( Ext.getBody(), "<div id='componentTestArea' style='visibility: hidden'></div>" )
beforeEach( ->
createComponentTestArea()
# For each test, create a MainTabPanel instance and render it.
view = Ext.create( "JasmineExample.view.MainTabPanel",
renderTo: "componentTestArea"
)
# Grab a reference to the ViewController for the MainTabPanel.
viewController = view.getController()
)
afterEach( ->
# After each test, destroy the view and clean up.
view.destroy()
view = null
viewController = null
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment