scrollList.spec.js 1.6 KB

12345678910111213141516171819202122232425262728
  1. describe('scrollList', () => {
  2. it('scroll to the specified position after clicking', () => {
  3. cy.visit('http://127.0.0.1:6006/iframe.html?id=scrolllist--scroll-list-simple&args=&viewMode=story');
  4. cy.get('.semi-scrolllist-item-sel').contains('1');
  5. cy.get('.semi-scrolllist-item').contains('5').click();
  6. cy.get('.semi-scrolllist-item-sel').contains('5');
  7. });
  8. // todo: due to the https://github.com/DouyinFE/semi-design/pull/2723, temporarily skip this test case
  9. // it.skip('infinite scroll', () => {
  10. // cy.visit('http://127.0.0.1:6006/iframe.html?id=scrolllist--single-scroll-list&args=&viewMode=story');
  11. // cy.wait(500);
  12. // cy.get('li[aria-selected="true"]').contains(0);
  13. // cy.get('.semi-scrolllist-item-wheel .semi-scrolllist-list-outer').scrollTo('right', { duration: 2000 });
  14. // cy.wait(1000);
  15. // cy.get('.semi-scrolllist-item-wheel .semi-scrolllist-list-outer').scrollTo('top', { duration: 2000 });
  16. // cy.wait(500);
  17. // cy.get('.semi-scrolllist-item-wheel .semi-scrolllist-list-outer').scrollTo('bottom', { duration: 2000 });
  18. // });
  19. // todo: due to the https://github.com/DouyinFE/semi-design/pull/2723, temporarily skip this test case
  20. // it.skip('click options', () => {
  21. // // cy.visit('http://127.0.0.1:6006/iframe.html?id=scrolllist--single-scroll-list&args=&viewMode=story');
  22. // // cy.get('li[aria-selected="true"]').contains(0);
  23. // // cy.get('.semi-scrolllist-list-outer').contains(59).click();
  24. // // cy.get('li[aria-selected="true"]').contains(0);
  25. // });
  26. });