Skip to content

Commit e251deb

Browse files
committed
test(combobox-web): type the lazy loading props in the component specs
The lazy loading scenario in SingleSelection and MultiSelection built an untyped props object with an enum cast. It is now a ComboboxContainerProps and the cast and its import are gone.
1 parent e948aad commit e251deb

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎packages/pluggableWidgets/combobox-web/src/__tests__/MultiSelection.spec.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
ReferenceSetValueBuilder,
1414
setupIntersectionObserverStub
1515
} from "@mendix/widget-plugin-test-utils";
16-
import { ComboboxContainerProps, OptionsSourceAssociationCaptionTypeEnum } from "../../typings/ComboboxProps";
16+
import { ComboboxContainerProps } from "../../typings/ComboboxProps";
1717
import Combobox from "../Combobox";
1818

1919
async function getInput(component: RenderResult): Promise<HTMLInputElement> {
@@ -437,10 +437,10 @@ describe("Combo box (Association)", () => {
437437
describe("with lazy loading", () => {
438438
it("calls loadMore only when menu opens", async () => {
439439
const setLimit = jest.fn();
440-
const lazyLoadingProps = {
440+
const lazyLoadingProps: ComboboxContainerProps = {
441441
...defaultProps,
442442
lazyLoading: true,
443-
optionsSourceAssociationCaptionType: "attribute" as OptionsSourceAssociationCaptionTypeEnum,
443+
optionsSourceAssociationCaptionType: "attribute",
444444
optionsSourceAssociationDataSource: {
445445
...defaultProps.optionsSourceAssociationDataSource,
446446
hasMoreItems: true,

‎packages/pluggableWidgets/combobox-web/src/__tests__/SingleSelection.spec.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
ReferenceValueBuilder,
1414
setupIntersectionObserverStub
1515
} from "@mendix/widget-plugin-test-utils";
16-
import { ComboboxContainerProps, OptionsSourceAssociationCaptionTypeEnum } from "../../typings/ComboboxProps";
16+
import { ComboboxContainerProps } from "../../typings/ComboboxProps";
1717
import Combobox from "../Combobox";
1818

1919
// function helper to ease DOM changes in development
@@ -172,10 +172,10 @@ describe("Combo box (Association)", () => {
172172
describe("with lazy loading", () => {
173173
it("calls loadMore only when menu opens", async () => {
174174
const setLimit = jest.fn();
175-
const lazyLoadingProps = {
175+
const lazyLoadingProps: ComboboxContainerProps = {
176176
...defaultProps,
177177
lazyLoading: true,
178-
optionsSourceAssociationCaptionType: "attribute" as OptionsSourceAssociationCaptionTypeEnum,
178+
optionsSourceAssociationCaptionType: "attribute",
179179
optionsSourceAssociationDataSource: {
180180
...defaultProps.optionsSourceAssociationDataSource,
181181
hasMoreItems: true,

0 commit comments

Comments
 (0)