浏览代码

fix: checkbox cypress error

zhangyumei.0319 3 年之前
父节点
当前提交
ed82bc86e6
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      cypress/integration/checkbox.spec.js
  2. 1 1
      packages/semi-foundation/checkbox/checkboxFoundation.ts

+ 2 - 2
cypress/integration/checkbox.spec.js

@@ -3,9 +3,9 @@ describe('checkbox', () => {
         cy.visit('http://127.0.0.1:6006/iframe.html?id=checkbox--checkbox-group-demo&args=&viewMode=story');
         cy.get('.semi-checkbox').eq(0).click();
         cy.focused().tab();
-        cy.get('.semi-checkbox-focus').type('{backspace}');
+        cy.focused().type('{backspace}');
         cy.get('.semi-checkbox').eq(1).get('.semi-checkbox-checked');
-        cy.get('.semi-checkbox-focus').type('{backspace}');
+        cy.focused().type('{backspace}');
         cy.get('.semi-checkbox').eq(1).get('.semi-checkbox-unChecked');
     });
 

+ 1 - 1
packages/semi-foundation/checkbox/checkboxFoundation.ts

@@ -131,7 +131,7 @@ class CheckboxFoundation<P = Record<string, any>, S = Record<string, any>> exten
     handleFocusVisible = (event: any) => {
         const { target } = event;
         try {
-            if( this.clickState ) {
+            if (this.clickState) {
                 this.clickState = false;
                 return;
             }