-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: convert Cypress files to TypeScript
- Loading branch information
1 parent
5602b99
commit 296f6b2
Showing
26 changed files
with
74 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/// <reference types="cypress" /> | ||
|
||
declare namespace Cypress { | ||
interface Chainable { | ||
isNotInViewport(element: string): Chainable<Element>; | ||
isInViewport(element: string): Chainable<Element>; | ||
renderFromStorybook(element: string): Chainable<Element>; | ||
pressEscapeKey(): Chainable<Element>; | ||
clickOutsideElement(): Chainable<Element>; | ||
tab(): Chainable<Element>; | ||
paste({ | ||
destinationSelector, | ||
pastePayload, | ||
}: { | ||
destinationSelector: string; | ||
pastePayload: string; | ||
}): Chainable<Element>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": ["es5", "dom"], | ||
"types": ["cypress", "node", "./support"] | ||
}, | ||
"include": ["**/*.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 12 additions & 12 deletions
24
src/utils/numberFromDimension/numberFromDimension.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import numberFromDimension from "." | ||
import numberFromDimension from "."; | ||
|
||
describe("numberFromDimension", () => { | ||
it("returns the numerical value from a css dimension", () => { | ||
const dimension = "12px" | ||
const numericalValue = 12 | ||
expect(numberFromDimension(dimension)).toEqual(numericalValue) | ||
}) | ||
const dimension = "12px"; | ||
const numericalValue = 12; | ||
|
||
expect(numberFromDimension(dimension)).toEqual(numericalValue); | ||
}); | ||
|
||
it("handles any css unit", () => { | ||
const dimension = "12deg" | ||
const numericalValue = 12 | ||
const dimension = "12deg"; | ||
const numericalValue = 12; | ||
|
||
expect(numberFromDimension(dimension)).toEqual(numericalValue) | ||
}) | ||
}) | ||
expect(numberFromDimension(dimension)).toEqual(numericalValue); | ||
}); | ||
}); |