Skip to content

Commit 4eedc6b

Browse files
committed
fix(pencil): illustrate the false positive of 'focus' regex matching 'focused'
1 parent b9f7a26 commit 4eedc6b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/rules/unsafe-to-chain-command.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const unsafeToChainActions = [
1919
'check',
2020
'dblclick',
2121
'each',
22-
'focus',
22+
'focus$',
2323
'rightclick',
2424
'screenshot',
2525
'scrollIntoView',

tests/lib/rules/unsafe-to-chain-command.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ ruleTester.run('action-ends-chain', rule, {
1414
code: 'cy.get("new-todo").type("todo A{enter}"); cy.get("new-todo").type("todo B{enter}"); cy.get("new-todo").should("have.class", "active");',
1515
parserOptions,
1616
},
17+
{
18+
code: 'cy.focused().should("be.visible");',
19+
parserOptions,
20+
},
1721
],
1822

1923
invalid: [

0 commit comments

Comments
 (0)