From 82bd59e79dfb93570198f1061d3aa2f4281e4575 Mon Sep 17 00:00:00 2001 From: yanzhuoran Date: Thu, 12 Sep 2024 14:11:07 +0800 Subject: [PATCH 1/2] fix: sync for cypress test script of hotKeys --- cypress/e2e/hotKeys.spec.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/cypress/e2e/hotKeys.spec.js b/cypress/e2e/hotKeys.spec.js index c7725f22aa..e0fdff91bc 100644 --- a/cypress/e2e/hotKeys.spec.js +++ b/cypress/e2e/hotKeys.spec.js @@ -1,11 +1,10 @@ describe('hotKeys', () => { - it('Clickable', () => { - cy.visit('http://127.0.0.1:6006/iframe.html?path=/story/hotkeys--clickable') + it('BasicUsage', () => { + cy.visit('http://127.0.0.1:6006/iframe.html?path=/story/hotkeys--demo') cy.wait(1000) - cy.get('body').click().type('{alt}{k}') - cy.get('div.semi-hotKeys').click() - cy.get('pre#pre').should('exist').and('have.text', '2') + cy.get('body').click().type('{control}{k}') + cy.get('pre#pre').should('exist').and('have.text', '1') }); it('Combine', () => { @@ -21,11 +20,4 @@ describe('hotKeys', () => { cy.get('input#test').type('{meta}{s}') cy.get('pre#pre').should('exist').and('have.text', '1') }); - - it('Disabled', () => { - cy.visit('http://127.0.0.1:6006/iframe.html?path=/story/hotkeys--disabled') - - cy.get('body').click().type('{meta}{k}') - cy.get('pre#pre').should('exist').and('have.text', '0') - }); }); \ No newline at end of file From 55db9dcffb38a7337a42f7b856bab9bff8b9958b Mon Sep 17 00:00:00 2001 From: yanzhuoran Date: Fri, 20 Sep 2024 14:50:18 +0800 Subject: [PATCH 2/2] fix: fix spell error in hotkeys --- packages/semi-ui/hotKeys/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/semi-ui/hotKeys/index.tsx b/packages/semi-ui/hotKeys/index.tsx index dcbbe1f814..b27b11e195 100644 --- a/packages/semi-ui/hotKeys/index.tsx +++ b/packages/semi-ui/hotKeys/index.tsx @@ -26,7 +26,7 @@ export interface HotKeysState { class HotKeys extends BaseComponent { static propTypes = { - preventDefalut: PropTypes.bool, + preventDefault: PropTypes.bool, hotKeys: PropTypes.arrayOf(PropTypes.string), content: PropTypes.arrayOf(PropTypes.string), onClick: PropTypes.func,