Created
April 10, 2018 03:04
-
-
Save haingdc/b0dac806c5d9008b887c3dffb679abfa to your computer and use it in GitHub Desktop.
Thao tác với DOM thông qua TDD
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
describe("#photoListToHTML()", function() { | |
it("should take an array of photo objects and convert them to an HTML list", function() { | |
var input = [ | |
{ | |
title: "This is a test", | |
url: "http://loremflickr.com/960/593", | |
}, | |
{ | |
title: "This is another test", | |
url: "http://loremflickr.com/960/593/puppy", | |
}, | |
], | |
expected = | |
'<ul><li><figure><img src="http://loremflickr.com/960/593" alt=""/>' + | |
"<figcaption>This is a test</figcaption></figure></li>" + | |
'<li><figure><img src="http://loremflickr.com/960/593/puppy" alt=""/>' + | |
"<figcaption>This is another test</figcaption></figure></li></ul>"; | |
expect(PhotoLister.photoListToHTML(input)).to.equal(expected); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment