Created
June 29, 2012 15:14
-
-
Save danscotton/3018518 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // -- 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