Rocky_Mountain_Vending/.pnpm-store/v10/files/85/d60d5026a9334cd0455e3f5459b68e8fbefd19a30b490b057070e123c7afb0057f2944e97e1430192b8a9c2f110914ee8e9eb029d4010d87fc1e5865c458ae
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

48 lines
1.1 KiB
Text

import { getDataAttributes } from "./getDataAttributes";
// Mocking the types that are defined elsewhere.
// TODO: does it work? Replace the types with the actual types.
interface PropsBase {
[key: string]: unknown;
}
test("return all data- attributes from the props", () => {
const props: PropsBase = {
"data-test-id": "123",
"data-role": "button",
"aria-label": "test element"
};
const result = getDataAttributes(props);
expect(result).toEqual({
"data-test-id": "123",
"data-role": "button"
});
});
test("return an empty object if there are no data- attributes", () => {
const props: PropsBase = {
"aria-label": "test element",
class: "example-class"
};
const result = getDataAttributes(props);
expect(result).toEqual({});
});
test("handle props with undefined or null values", () => {
const props: PropsBase = {
"data-test-id": undefined,
"data-role": null,
"aria-hidden": "true"
};
const result = getDataAttributes(props);
expect(result).toEqual({
"data-test-id": undefined,
"data-role": null
});
});