Skip to content

Instantly share code, notes, and snippets.

@haingdc
Last active April 10, 2018 02:59
Show Gist options
  • Save haingdc/9a04de655ddd5c8ed803e0013a927781 to your computer and use it in GitHub Desktop.
Save haingdc/9a04de655ddd5c8ed803e0013a927781 to your computer and use it in GitHub Desktop.
Thao tác với DOM thông qua TDD
// 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);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment