Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/queuepro/node_modules/list.pagination.js/test/ drwxrwxr-x | |
| Viewing file: Select action/file-type: describe('Custom settings, innerWindow: 1, outerWindow: 1, left: 2, right: 1', function() {
var list,
itemHTML,
pagination;
before(function() {
itemHTML = fixture.list(['name'])
list = new List('list', {
valueNames: ['name'],
item: itemHTML,
page: 2,
plugins: [
ListPagination({
innerWindow: 1,
outerWindow: 1,
left: 2,
right: 1
})
]
}, fixture.all);
pagination = $('.pagination');
});
after(function() {
fixture.removeList();
});
it('should have default settings', function() {
expect(pagination.find('a').size()).to.equal(4);
expect(pagination.find('a').get(0).innerHTML).to.equal("1");
expect(pagination.find('a').get(1).innerHTML).to.equal("2");
expect(pagination.find('a').get(2).innerHTML).to.equal("...");
expect(pagination.find('a').get(3).innerHTML).to.equal("9");
expect(pagination.find('a').get(4)).to.equal(undefined);
});
it('should test show(7,2)', function() {
list.show(7, 2);
expect(pagination.find('a').size()).to.equal(7);
expect(pagination.find('a').get(0).innerHTML).to.equal("1");
expect(pagination.find('a').get(1).innerHTML).to.equal("2");
expect(pagination.find('a').get(2).innerHTML).to.equal("3");
expect(pagination.find('a').get(3).innerHTML).to.equal("4");
expect(pagination.find('a').get(4).innerHTML).to.equal("5");
expect(pagination.find('a').get(5).innerHTML).to.equal("...");
expect(pagination.find('a').get(6).innerHTML).to.equal("9");
expect(pagination.find('a').get(7)).to.equal(undefined);
expect($(pagination.find('li').get(2)).hasClass('active')).to.equal(false);
expect($(pagination.find('li').get(3)).hasClass('active')).to.equal(true);
expect($(pagination.find('li').get(4)).hasClass('active')).to.equal(false);
});
it('should test show(12,2)', function() {
list.show(12, 2);
expect(pagination.find('a').size()).to.equal(8);
expect(pagination.find('a').get(0).innerHTML).to.equal("1");
expect(pagination.find('a').get(1).innerHTML).to.equal("2");
expect(pagination.find('a').get(2).innerHTML).to.equal("...");
expect(pagination.find('a').get(3).innerHTML).to.equal("5");
expect(pagination.find('a').get(4).innerHTML).to.equal("6");
expect(pagination.find('a').get(5).innerHTML).to.equal("7");
expect(pagination.find('a').get(6).innerHTML).to.equal("...");
expect(pagination.find('a').get(7).innerHTML).to.equal("9");
expect(pagination.find('a').get(8)).to.equal(undefined);
expect($(pagination.find('li').get(3)).hasClass('active')).to.equal(false);
expect($(pagination.find('li').get(4)).hasClass('active')).to.equal(true);
expect($(pagination.find('li').get(5)).hasClass('active')).to.equal(false);
});
it('should show last page with show(17,2)', function() {
list.show(17, 2);
expect(pagination.find('a').size()).to.equal(5);
expect(pagination.find('a').get(0).innerHTML).to.equal("1");
expect(pagination.find('a').get(1).innerHTML).to.equal("2");
expect(pagination.find('a').get(2).innerHTML).to.equal("...");
expect(pagination.find('a').get(3).innerHTML).to.equal("8");
expect(pagination.find('a').get(4).innerHTML).to.equal("9");
expect(pagination.find('a').get(5)).to.equal(undefined);
expect($(pagination.find('li').get(2)).hasClass('active')).to.equal(false);
expect($(pagination.find('li').get(3)).hasClass('active')).to.equal(false);
expect($(pagination.find('li').get(4)).hasClass('active')).to.equal(true);
});
}); |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0175 ]-- |