This repository has been archived by the owner on Dec 21, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Robert-Frampton
authored and
Jonathan Mak
committed
Dec 28, 2013
1 parent
052ac96
commit 82168bf
Showing
2 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'] | ||
}); |