Skip to content

Commit

Permalink
Merge 7941f1a into ad6a1b0
Browse files Browse the repository at this point in the history
  • Loading branch information
jussi-kalliokoski committed Sep 2, 2014
2 parents ad6a1b0 + 7941f1a commit ee6eb97
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions Carousel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ module.exports = React.createClass({
className: this.props.baseClass + "__page",
key: buffer.index,
style: this.calculatePageStyle(buffer.index),
"data-index": buffer.pageIndex,
}, pageView);
}.bind(this));
},
Expand Down
13 changes: 11 additions & 2 deletions test/CarouselSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,24 @@ describe("Carousel", function () {

function expectPages (list) {
expectChildrenByClassName("merry-go-round__page", list.length);
var actual = getPages().map(function (page) {
var contents = getPages().map(function (page) {
if ( page.childNodes.length === 0 ) {
return null;
}

return getElementsByClassName(page, "dummy")[0].innerHTML;
});

expect(actual).to.eql(list);
var indices = getPages().map(function (page) {
if ( page.childNodes.length === 0 ) {
return null;
}

return page.getAttribute("data-index");
});

expect(contents).to.eql(list);
expect(indices).to.eql(list);
}

function expectSliderPosition (x, y) {
Expand Down

0 comments on commit ee6eb97

Please sign in to comment.