Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
AUI-1106 Pagination tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Frampton authored and Jonathan Mak committed Dec 28, 2013
1 parent 052ac96 commit 82168bf
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/aui-pagination/tests/unit/index.html
Expand Up @@ -12,6 +12,8 @@
<body class="yui3-skin-sam">
<div id="logger"></div>

<div id="pagination"></div>

<script>
YUI({
coverage: ['aui-pagination'],
Expand Down
41 changes: 37 additions & 4 deletions src/aui-pagination/tests/unit/js/tests.js
@@ -1,16 +1,49 @@
YUI.add('aui-pagination-tests', function(Y) {

//--------------------------------------------------------------------------
// Pagination Tests
//--------------------------------------------------------------------------

var suite = new Y.Test.Suite('aui-pagination');

var pagination = new Y.Pagination({
boundingBox: '#pagination',
circular: false,
showControls: false,
total: 10
}).render();

suite.add(new Y.Test.Case({
name: 'Automated Tests',
'test is empty': function() {
Y.Assert.pass('No Tests Provided For This Module');

name: 'Pagination control rendering tests',

/**
* @tests AUI-1106
*/
'assert that pagination controls do not render': function() {
var instance = this,
paginationContent,
paginationItems;

paginationContent = Y.one('#pagination .pagination-content');
paginationItems = paginationContent.all('li');

Y.Test.Assert.isNull(paginationContent.one('.pagination-control'));

instance._assertItemsCanBeSelectedWhenControlsAreDisabled(paginationItems.item(1));

instance._assertItemsCanBeSelectedWhenControlsAreDisabled(paginationItems.item(0));
},

_assertItemsCanBeSelectedWhenControlsAreDisabled: function(item) {
item.simulate('click');

Y.Test.Assert.isTrue(item.hasClass('active'));
}
}));

Y.Test.Runner.add(suite);

}, '', {
requires: ['test']
requires: ['test', 'aui-pagination', 'node-event-simulate']
});

0 comments on commit 82168bf

Please sign in to comment.