react18-tools/react-mouse-trail

View on GitHub
scripts/templates/component.test.hbs

Summary

Maintainability
Test Coverage
import { cleanup, render, screen } from "@testing-library/react";
import { afterEach, describe, test } from "vitest";
import { {{ pascalCase name }} } from "./{{ kebabCase name }}";

describe.concurrent("{{ kebabCase name }}", () => {
    afterEach(cleanup);

    test("Dummy test - test if renders without errors", ({ expect }) => {
        const clx = "my-class";
        render(<{{ pascalCase name }} className={clx} />);
        expect(screen.getByTestId("{{ kebabCase name }}").classList).toContain(clx);
    });
});