Skip to content

Instantly share code, notes, and snippets.

@zaach
Created October 9, 2012 22:14
Show Gist options
  • Save zaach/3861782 to your computer and use it in GitHub Desktop.
Save zaach/3861782 to your computer and use it in GitHub Desktop.
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