-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #250 from thefrontside/dl/update-typescript-5.4
Update TypeScript to v5.4
- Loading branch information
Showing
37 changed files
with
59,304 additions
and
41,453 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
"@interactors/core": patch | ||
"@interactors/globals": patch | ||
"@interactors/html": patch | ||
"@interactors/keyboard": patch | ||
"@interactors/material-ui": patch | ||
"@interactors/with-cypress": patch | ||
--- | ||
|
||
Update TypeScript to v5.4 |
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
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
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 @@ | ||
nodeLinker: node-modules |
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
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,62 @@ | ||
import { expectType, expectAssignable, expectError } from 'tsd'; | ||
import { createInteractor, Interactor, AssertionInteraction } from '../src/index'; | ||
|
||
const TextField = createInteractor<HTMLInputElement>('text field') | ||
.selector('input') | ||
.locator((element) => element.id) | ||
.filters({ | ||
enabled: { | ||
apply: (element) => !element.disabled, | ||
default: true | ||
}, | ||
value: (element) => element.value | ||
}) | ||
.actions({ | ||
fillIn: ({ perform }, value: string) => perform((element) => { element.value = value }) | ||
}); | ||
|
||
const Div = createInteractor('div') | ||
.locator((element) => element.id || ""); | ||
|
||
expectAssignable<Interactor<HTMLInputElement, Record<string, unknown>>>(TextField('foo', { enabled: true, value: 'thing' })); | ||
|
||
expectAssignable<Interactor<HTMLInputElement, Record<string, unknown>>>(TextField('foo', { enabled: false })); | ||
|
||
expectType<AssertionInteraction<HTMLInputElement, void>>(TextField('foo').has({ value: 'thing' })); | ||
expectType<AssertionInteraction<HTMLInputElement, void>>(TextField('foo').is({ enabled: true })); | ||
|
||
// cannot use wrong type of filter | ||
|
||
expectError(TextField('foo', { enabled: 'thing' })); | ||
expectError(TextField('foo', { value: true })); | ||
expectError(TextField('foo', { value: 123 })); | ||
|
||
// cannot use filter which doesn't exist | ||
|
||
expectError(TextField('foo', { blah: 'thing' })); | ||
|
||
expectError(TextField({ blah: 'thing' })); | ||
|
||
// cannot use wrong type of filter with is | ||
|
||
expectError(TextField('foo').is({ enabled: 'thing' })); | ||
expectError(TextField('foo').is({ value: true })); | ||
expectError(TextField('foo').is({ value: 123 })); | ||
|
||
// cannot use filter which doesn't exist with is | ||
|
||
expectError(TextField('foo').is({ blah: 'thing' })); | ||
|
||
// cannot use wrong type of filter with has | ||
|
||
expectError(TextField('foo').has({ enabled: 'thing' })); | ||
expectError(TextField('foo').has({ value: true })); | ||
expectError(TextField('foo').has({ value: 123 })); | ||
|
||
// cannot use filter which doesn't exist with has | ||
|
||
expectError(TextField('foo').has({ blah: 'thing' })); | ||
|
||
// cannot use filter on interactor which has no filters | ||
// TODO: this should fail! | ||
// expectError(Div('foo').has({ blah: 'thing' })); |
Oops, something went wrong.