Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfranco committed Jan 29, 2025
1 parent 8396230 commit 5108887
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/calcite-components/src/tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,35 @@ export async function toElementHandle(element: E2EElement): Promise<ElementHandl
*
* Note: values returned can only be serializable values.
*
* @example
*
* it("props are updated on change emit", async () => {
* const page = await newE2EPage();
* await page.setContent(html`
* <calcite-combobox>
* <!-- ... -->
* </calcite-combobox>
* `);
* const propValueAsserter = await createEventTimePropValuesAsserter<Combobox>(
* page,
* {
* selector: "calcite-combobox",
* eventName: "calciteComboboxChange",
* props: ["value", "selectedItems"],
* },
* async (propValues) => {
* expect(propValues.value).toBe("K");
* expect(propValues.selectedItems).toHaveLength(1);
* },
* );
* const combobox = await page.find("calcite-combobox");
* await combobox.callMethod("setFocus");
* await combobox.press("K");
* await combobox.press("Enter");
*
* await expect(propValueAsserter()).resolves.toBe(undefined);
* });
*
* @param page
* @param propValuesTarget
* @param propValuesTarget.selector
Expand Down

0 comments on commit 5108887

Please sign in to comment.