New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Improve pkg/driver types part 2 #21610
Conversation
Thanks for taking the time to open a PR!
|
export interface KeyboardState { | ||
keyboardModifiers?: KeyboardModifiers | ||
} | ||
|
||
export interface ProxyState<T> { | ||
<K extends keyof T>(arg: K): T[K] | undefined | ||
<K extends keyof T>(arg: K, arg2: T[K] | null): void | ||
} | ||
|
||
export type State = ProxyState<KeyboardState> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is added before StateFunc
type is created. Now, it's OK to remove them.
type modifierKeyDetails = KeyDetails & { | ||
type KeyModifiers = { | ||
key: keyof typeof keyToModifierMap | ||
} | ||
|
||
const isModifier = (details: KeyInfo): details is modifierKeyDetails => { | ||
const isModifier = (details: KeyInfo): details is KeyDetails & KeyModifiers => { | ||
return details.type === 'key' && !!keyToModifierMap[details.key] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modifierKeyDetails
doesn't follow the TS naming conventions (naming types with the capital letter.) And KeyDetails &
cause errors in other files.
// @ts-ignore | ||
import { registerFetch } from 'unfetch' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//@ts-ignore
is unnecessary because the type of registerFetch
is added with patch-package
.
// also reset recentlyReady back to null | ||
this.state('recentlyReady', null) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interface ICyFocused extends Omit< | ||
IFocused, | ||
'documentHasFocus' | 'interceptFocus' | 'interceptBlur' | ||
> {} | ||
|
||
interface ICySnapshots extends Omit< | ||
ISnapshots, | ||
'onCssModified' | 'onBeforeWindowLoad' | ||
> {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first, I omit those APIs when defining interface
s because they're not $Cy
members. But I learned that they are used in cy
folder files.
So, I removed omit
in the definitions and created new definitions here.
const num = _.filter(calls, (call) => _.isEqual(call.args, [50, true, 'dblclick'])) | ||
const num = _.filter(calls, (call) => _.isEqual(call.args, [50, true])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cy.timeout
has 2 args, not 3.
@sainthkh - Sorry it's taken so long to get this in, and thanks for your patience. As you may have noticed, we've been having some flake issues recently. It's still on my list here, not forgotten. |
@@ -128,7 +131,7 @@ export default (Commands, Cypress, cy, state, config) => { | |||
|
|||
// add this delay delta to the runnables timeout because we delay | |||
// by it below before performing each click | |||
cy.timeout($actionability.delay, true, eventName) | |||
cy.timeout($actionability.delay, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to clean this up.
User facing changelog
N/A. It's for internal use.
Additional details
How has the user experience changed?
N/A
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?