@nosto/nosto-js
    Preparing search index...

    Function mockAddSkuToCart

    • Registers a mock function and assigns it to window.Nosto.addSkuToCart.

      Parameters

      • mockFn: (
            product: ProductIdentifier,
            slotIdOrElement?: SlotReference,
            quantity?: number,
        ) => Promise<void> = ...

        Optional mock function to use. If not provided, a simple implementation is used.

          • (
                product: ProductIdentifier,
                slotIdOrElement?: SlotReference,
                quantity?: number,
            ): Promise<void>
          • Add a product to the cart.

            Parameters

            • product: ProductIdentifier

              The product identifier.

            • OptionalslotIdOrElement: SlotReference

              The slot ID or element to use for the product.

            • Optionalquantity: number

              The quantity of the product to add.

            Returns Promise<void>

      Returns (
          product: ProductIdentifier,
          slotIdOrElement?: SlotReference,
          quantity?: number,
      ) => Promise<void>

      The mock function that was assigned to window.Nosto.addSkuToCart.

        • (
              product: ProductIdentifier,
              slotIdOrElement?: SlotReference,
              quantity?: number,
          ): Promise<void>
        • Add a product to the cart.

          Parameters

          • product: ProductIdentifier

            The product identifier.

          • OptionalslotIdOrElement: SlotReference

            The slot ID or element to use for the product.

          • Optionalquantity: number

            The quantity of the product to add.

          Returns Promise<void>