# Testing

### Dashboard

Test the functionality of the dashboard within the Business Manager module.

* **Search**: Ensure the charity search works correctly by delivering search results after 3 characters are typed into the input.
* **Save Configuration**: Save a configuration and reload the dashboard to confirm that the settings have been saved.

### Donation Confirmation Widget

Test the functionality of the donation confirmation widget on checkout.

* **Donation Type | Donor** — Check that as each actor is set, the donation confirmation widget displays the correct layout and copy from the associated content assets.
* **Donation Type | Option** — Check that as each option is set, the donation is calculated correctly (refer to Donation Type: Option section for details on calculations)
* **Agreed to Donate** — For donors **Customer** and **Customer/Merchant Match**, ensure when checking the box to agree to donate that the order total is recalculated; adding and removing the donation amount respectively.

### Charity Selector Widget

Test the functionality of the charity selector widget on order confirmation.

* **Displays Correctly** — The charity selection widget should display only if the customer has checked the box on the donation confirmation widget (applies to when donation type actor is set to **Customer** or **Customer/Merchant Match**). Also, check that the copy from the content assets are correct.
* **Send It** — Ensure the **Send It** action performs correctly and that the correct messaging is displayed after the action.
* **Timer End** — Ensure the timer ending action performs correctly and that the correct messaging is displayed after the timer counts down (10 minutes after the confirmation page load the timer should trigger its actions).

### ChangeUp Custom Order Attributes

Check the custom attributes on the test orders placed while testing the different configurations. Ensure that the donation amounts are applied to the correct attribute (customer and/or merchant).

### Donation Reporting

Within the code in the distribution, navigate to **cartridges > int\_changeup\_sfra > cartridge > tests > endpoints.txt**. Using VS Code, install the **REST Client for Visual Studio Code extension** referenced at the top of the file. Read the documentation on how to trigger a request. Replace \[your-instance- url.demandware.net] with the domain of the instance you are testing on. Trigger the request with a JSON request using orders that you have created testing the ChangeUp cartridge. Once this is complete, the order should have confirmation UUIDS within the ChangeUp custom attribute group. This confirms the necessary reporting data has been transmitted.<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.changeup.com/salesforce/salesforce-b2c-commerce/testing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
