Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
290 stars 75 forks source link

Improve doc formatting and add examples to commonTest utils #8079

Closed Elijbet closed 6 months ago

Elijbet commented 1 year ago

Description

Enhance the documentation of the commonTest utilities by incorporating examples and cleaning up the formatting, similar to the illustration provided below.

/**
 * Helper for asserting slots.
 *
 * Note that this helper should be used within a describe block.
 *
 * @example
 * describe("slots", () => {
 *    slots("calcite-stack", SLOTS)
 * })
 *
 * @param {string} componentTagOrHTML - The component tag or HTML markup to test against.
 * @param {Record<string, string> | string[]} slots - A component's SLOTS resource object or an array of slot names.
 * @param {boolean} includeDefaultSlot - When true, it will run assertions on the default slot.
 */
export function slots(

Proposed Advantages

Readability and ease of use.

Which Component

commonTest utilities

Relevant Info

No response

Calcite package

jcfranco commented 6 months ago

I believe this is now complete based on current state of test helpers (thanks @Elijbet!).

Closing!