Last active
April 10, 2018 03:20
-
-
Save haingdc/b3c6357db314da4048cd11fb0b6847c2 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
// photo-lister-spec.js | |
describe("#photoToListItem()", function() { | |
it("should take a photo object and return a list item string", function() { | |
var input = { | |
title: "This is a test", | |
url: "http://loremflickr.com/960/593", | |
}, | |
expected = | |
'<li><figure><img src="http://loremflickr.com/960/593" alt=""/>' + | |
"<figcaption>This is a test</figcaption></figure></li>"; | |
expect(PhotoLister.photoToListItem(input)).to.equal(expected); | |
input = { // thêm mới đoạn này | |
title: "This is another test", | |
url: "http://loremflickr.com/960/593/puppy", | |
}; | |
expected = | |
'<li><figure><img src="http://loremflickr.com/960/593/puppy" alt=""/>' + | |
"<figcaption>This is another test</figcaption></figure></li>"; | |
expect(PhotoLister.photoToListItem(input)).to.equal(expected); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment