Skip to content

Instantly share code, notes, and snippets.

@danscotton
Created June 29, 2012 15:14
Show Gist options
  • Select an option

  • Save danscotton/3018518 to your computer and use it in GitHub Desktop.

Select an option

Save danscotton/3018518 to your computer and use it in GitHub Desktop.
// -- changed lines
define(['module/bootstrap', 'module/hyperpuff/minihyper'], function(news, MiniHyper) {
module('MiniHyper');
test('has an init method', function() {
ok('init' in MiniHyper);
});
test('creates a mini-hyper from existing markup', function() {
expect(3);
equal(news.$('.pullout').length, 0);
MiniHyper.init();
equal(news.$('.pullout').length, 1);
var match = [
'<aside class="pullout mini-hyper">',
'<div class="pullout-inner">',
'<h3 class="heading">Hyper Title</h3>',
'<div class="related-items">',
'<article class="story">Article One</article>',
'<article class="story">Article Two</article>',
'<article class="story">Article Three</article>',
'<article class="story">Article Four</article>',
'</div>',
'</div>',
'</aside>'
].join('');
-- var container = document.createElement('div');
-- container.appendChild(news.$('.pullout')[0]);
-- equal(container.innerHTML, match);
});
test('inserts mini-hyper before .introduction', function() {
MiniHyper.init();
ok(news.$('.pullout + .introduction').length);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment