hotKeys.spec.js 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. describe('hotKeys', () => {
  2. it('Clickable', () => {
  3. cy.visit('http://127.0.0.1:6006/iframe.html?path=/story/hotkeys--clickable')
  4. cy.wait(1000)
  5. cy.get('body').click().type('{alt}{k}')
  6. cy.get('div.semi-hotKeys').click()
  7. cy.get('pre#pre').should('exist').and('have.text', '2')
  8. });
  9. it('Combine', () => {
  10. cy.visit('http://127.0.0.1:6006/iframe.html?path=/story/hotkeys--combine')
  11. cy.get('body').click().type('{meta}{alt}{k}').type('{meta}{shift}{k}')
  12. cy.get('pre#pre').should('exist').and('have.text', '2')
  13. });
  14. it('Target', () => {
  15. cy.visit('http://127.0.0.1:6006/iframe.html?path=/story/hotkeys--target')
  16. cy.get('input#test').type('{meta}{s}')
  17. cy.get('pre#pre').should('exist').and('have.text', '1')
  18. });
  19. it('Disabled', () => {
  20. cy.visit('http://127.0.0.1:6006/iframe.html?path=/story/hotkeys--disabled')
  21. cy.get('body').click().type('{meta}{k}')
  22. cy.get('pre#pre').should('exist').and('have.text', '0')
  23. });
  24. });