> ## Documentation Index
> Fetch the complete documentation index at: https://docs.authsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing rules

> Learn how to test your rules with Authsignal's test action feature.

export const ActionStatePill = ({state}) => {
  const pillConfig = {
    CHALLENGE_FAILED: {
      className: "action-state-pill__CHALLENGE_FAILED",
      label: "Challenge failed"
    },
    BLOCK: {
      className: "action-state-pill__BLOCK",
      label: "Blocked"
    },
    CHALLENGE_REQUIRED: {
      className: "action-state-pill__CHALLENGE_REQUIRED",
      label: "Challenge required"
    },
    CHALLENGE_SUCCEEDED: {
      className: "action-state-pill__CHALLENGE_SUCCEEDED",
      label: "Challenge succeeded"
    },
    REVIEW_REQUIRED: {
      className: "action-state-pill__REVIEW_REQUIRED",
      label: "Review required"
    },
    REVIEW_SUCCEEDED: {
      className: "action-state-pill__REVIEW_SUCCEEDED",
      label: "Review succeeded"
    },
    REVIEW_FAILED: {
      className: "action-state-pill__REVIEW_FAILED",
      label: "Review failed"
    },
    ALLOW: {
      className: "action-state-pill__ALLOW",
      label: "Allowed"
    }
  };
  const {className, label} = pillConfig[state];
  return <span className={`action-state-pill ${className}`}>{label}</span>;
};

For convenience, Authsignal lets you create test actions directly in the portal, without having to track them from within your application.

## How to test your rules

### 1. Start a test action

Go to the **Latest activity** tab of your action and click **Track a test action** button.

<Frame>
  <img src="https://mintcdn.com/authsignal-23/o0kRW78VfDNgNDjk/images/docs/learn/tracking-actions/creating-rules/track-test-action-button.png?fit=max&auto=format&n=o0kRW78VfDNgNDjk&q=85&s=a1b3d6ddae5e8d1b00d5a255613bafd4" alt="Track a test action button" width="1020" height="128" data-path="images/docs/learn/tracking-actions/creating-rules/track-test-action-button.png" />
</Frame>

### 2. Add test data

A dialog will popup with default values for `userId`, `email`, `deviceId`, `userAgent`, and `ipAddress`. You can change these to test different scenarios.

If you're using a custom data points, you can add them here too .

<Frame>
  <img src="https://mintcdn.com/authsignal-23/o0kRW78VfDNgNDjk/images/docs/learn/tracking-actions/creating-rules/track-test-action-payload.png?fit=max&auto=format&n=o0kRW78VfDNgNDjk&q=85&s=c95f1606054efc215288970fdd00cd26" alt="Track a test action payload" width="664" height="509" data-path="images/docs/learn/tracking-actions/creating-rules/track-test-action-payload.png" />
</Frame>

### 3. Track the action

Click **Track action** and you will see a breakdown of the action response.

<Frame>
  <img src="https://mintcdn.com/authsignal-23/o0kRW78VfDNgNDjk/images/docs/learn/tracking-actions/creating-rules/track-test-action-response-1.png?fit=max&auto=format&n=o0kRW78VfDNgNDjk&q=85&s=da13e8a7d37ca3ccb07ab414dad2d160" alt="Track a test action response 1" width="660" height="508" data-path="images/docs/learn/tracking-actions/creating-rules/track-test-action-response-1.png" />
</Frame>

## Understanding test results

When you track a test action with our **Withdrawing high amount of funds** rule, you should see that the action state is <ActionStatePill state="CHALLENGE_REQUIRED" />.

### What happens next?

If the user hasn't enrolled any authenticators yet, they'll be directed to an enrollment page first, then proceed with the challenge. Click the **Pre-built UI enrollment URL** to set up authentication methods.

Once the user has enrolled authenticators, they'll be able to complete the challenge to proceed with the action.

<Frame>
  <img src="https://mintcdn.com/authsignal-23/o0kRW78VfDNgNDjk/images/docs/learn/tracking-actions/creating-rules/track-test-action-response-2.png?fit=max&auto=format&n=o0kRW78VfDNgNDjk&q=85&s=8890b7b63e48bd0d188c76db7eaeed37" alt="Track a test action response 2" width="663" height="510" data-path="images/docs/learn/tracking-actions/creating-rules/track-test-action-response-2.png" />
</Frame>

### View the action details

If you want to see a full breakdown of a user action, refresh the page and you should see the test action you just created in the **Latest activity** table. Click `View details` to see the full breakdown of the action.

<Frame>
  <img src="https://mintcdn.com/authsignal-23/o0kRW78VfDNgNDjk/images/docs/learn/tracking-actions/creating-rules/view-action-details.png?fit=max&auto=format&n=o0kRW78VfDNgNDjk&q=85&s=6ab0c819533ef762bb522c7bde0c578c" alt="View action details" width="935" height="71" data-path="images/docs/learn/tracking-actions/creating-rules/view-action-details.png" />
</Frame>

<Frame caption="A summary of some of the action details.">
  <img src="https://mintcdn.com/authsignal-23/o0kRW78VfDNgNDjk/images/docs/learn/tracking-actions/creating-rules/action-data.png?fit=max&auto=format&n=o0kRW78VfDNgNDjk&q=85&s=45da7c75883956355b2ec2f0deeb6e5b" alt="Action data" width="415" height="495" data-path="images/docs/learn/tracking-actions/creating-rules/action-data.png" />
</Frame>
