Created
October 9, 2012 22:14
-
-
Save zaach/3861782 to your computer and use it in GitHub Desktop.
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
requireApp('system/js/identity.js'); | |
requireApp('system/test/unit/mock_chrome_event.js'); | |
requireApp('system/test/unit/mock_popup_manager.js'); | |
suite('identity', function() { | |
var subject; | |
var realPopupManager; | |
suiteSetup(function() { | |
subject = Identity; | |
realPopupManager = window.PopupManager; | |
window.PopupManager = MockPopupManager; | |
}); | |
suiteTeardown(function() { | |
window.PopupManager = realPopupManager; | |
}); | |
setup(function() {}); | |
teardown(function() { | |
MockPopupManager.mTearDown(); | |
}); | |
suite('open popup', function() { | |
setup(function() { | |
var event = new MockChromeEvent({ | |
type: 'open-id-dialog' | |
}); | |
subject.handleEvent(event); | |
}); | |
test(function() { | |
console.log(realPopupManager); | |
console.log(window.PopupManager); | |
assert.equal('IdentityFlow', MockPopupManager.mTitle); | |
}); | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment