-
Notifications
You must be signed in to change notification settings - Fork 76
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
refactor(tests): reduce TypeScript errors #10344
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1632,7 +1632,7 @@ describe("calcite-combobox", () => { | |
let element: E2EElement; | ||
let comboboxItem: E2EElement; | ||
let itemNestedLi: E2EElement; | ||
let closeEvent: Promise<void>; | ||
let closeEvent: Promise<unknown>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stencil's waitForEvent has return type (at runtime, Stencil's waitForEvent also returned Promise, but they didn't publicly expose the SerializedEvent type) |
||
|
||
beforeEach(async () => { | ||
page = await newE2EPage(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ export class ListItemGroup implements InteractiveComponent { | |
* Fires when changes occur in the default slot, notifying parent lists of the changes. | ||
*/ | ||
@Event({ cancelable: false }) | ||
calciteInternalListItemGroupDefaultSlotChange: EventEmitter<DragEvent>; | ||
calciteInternalListItemGroupDefaultSlotChange: EventEmitter<void>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it didn't actually emit this type, and no one was listening for it to emit this type |
||
|
||
// -------------------------------------------------------------------------- | ||
// | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,9 +90,9 @@ export class Loader implements LocalizedComponent { | |
return ( | ||
<Host | ||
aria-label={label} | ||
aria-valuemax={isDeterminate ? 100 : undefined} | ||
aria-valuemin={isDeterminate ? 0 : undefined} | ||
aria-valuenow={isDeterminate ? valueNow : undefined} | ||
aria-valuemax={isDeterminate ? "100" : undefined} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stencil's |
||
aria-valuemin={isDeterminate ? "0" : undefined} | ||
aria-valuenow={isDeterminate ? valueNow.toString() : undefined} | ||
id={id} | ||
role="progressbar" | ||
> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -292,7 +292,7 @@ describe("calcite-segmented-control", () => { | |
|
||
async function cycleThroughItemsAndAssertValue(keys: "left-right" | "up-down"): Promise<void> { | ||
const [moveBeforeArrowKey, moveAfterArrowKey] = | ||
keys === "left-right" ? ["ArrowLeft", "ArrowRight"] : ["ArrowUp", "ArrowDown"]; | ||
keys === "left-right" ? (["ArrowLeft", "ArrowRight"] as const) : (["ArrowUp", "ArrowDown"] as const); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lumina's typings for |
||
|
||
await element.press(moveAfterArrowKey); | ||
await page.waitForChanges(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,11 +250,11 @@ export class Table implements LocalizedComponent, LoadableComponent, T9nComponen | |
} | ||
|
||
@Listen("calciteInternalTableRowFocusRequest") | ||
calciteInternalTableRowFocusEvent(event: TableRowFocusEvent): void { | ||
const cellPosition = event["detail"].cellPosition; | ||
const rowPos = event["detail"].rowPosition; | ||
const destination = event["detail"].destination; | ||
const lastCell = event["detail"].lastCell; | ||
calciteInternalTableRowFocusEvent(event: CustomEvent<TableRowFocusEvent>): void { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like a mistake in typing. |
||
const cellPosition = event.detail.cellPosition; | ||
const rowPos = event.detail.rowPosition; | ||
const destination = event.detail.destination; | ||
const lastCell = event.detail.lastCell; | ||
|
||
const visibleBody = this.bodyRows?.filter((row) => !row.hidden); | ||
const visibleAll = this.allRows?.filter((row) => !row.hidden); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,7 +151,7 @@ describe("calcite-text-area", () => { | |
await page.setContent("<calcite-text-area></calcite-text-area>"); | ||
|
||
const element = await page.find("calcite-text-area"); | ||
element.setAttribute("max-length", 5); | ||
element.setAttribute("max-length", "5"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stencil's E2EElement.setAttribute had type |
||
await page.waitForChanges(); | ||
|
||
await page.keyboard.press("Tab"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,7 +202,7 @@ export class TimePicker | |
/** | ||
* @internal | ||
*/ | ||
@Event({ cancelable: false }) calciteInternalTimePickerChange: EventEmitter<string>; | ||
@Event({ cancelable: false }) calciteInternalTimePickerChange: EventEmitter<void>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. never actually included a |
||
|
||
//-------------------------------------------------------------------------- | ||
// | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,7 @@ export async function t9n(componentTestSetup: ComponentTestSetup): Promise<void> | |
return new Response(new Blob([JSON.stringify(fakeEsMessages, null, 2)], { type: "application/json" })); | ||
} | ||
|
||
return orig.call(input, init); | ||
return orig.call(window, input, init); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. First argument to |
||
}; | ||
}, | ||
enMessages, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -665,8 +665,8 @@ describe("dom", () => { | |
|
||
let element: HTMLDivElement; | ||
let dispatchTransitionEvent: TransitionEventDispatcher; | ||
let onStartCallback: jest.Mock<any, any, any>; | ||
let onEndCallback: jest.Mock<any, any, any>; | ||
let onStartCallback: jest.Mock; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With this change, the type would be equivalent both in Jest and Vite. |
||
let onEndCallback: jest.Mock; | ||
|
||
beforeEach(() => { | ||
dispatchTransitionEvent = createTransitionEventDispatcher(); | ||
|
@@ -766,8 +766,8 @@ describe("dom", () => { | |
|
||
let element: HTMLDivElement; | ||
let dispatchAnimationEvent: AnimationEventDispatcher; | ||
let onStartCallback: jest.Mock<any, any, any>; | ||
let onEndCallback: jest.Mock<any, any, any>; | ||
let onStartCallback: jest.Mock; | ||
let onEndCallback: jest.Mock; | ||
|
||
beforeEach(() => { | ||
dispatchAnimationEvent = createAnimationEventDispatcher(); | ||
|
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 is a boolean attribute
Before it was being set here to
selected="true"