diff --git a/ui/app/(prowler)/attack-paths/(workflow)/query-builder/_components/query-execution-error.test.tsx b/ui/app/(prowler)/attack-paths/(workflow)/query-builder/_components/query-execution-error.test.tsx index 560aa2d434..80863bd6bd 100644 --- a/ui/app/(prowler)/attack-paths/(workflow)/query-builder/_components/query-execution-error.test.tsx +++ b/ui/app/(prowler)/attack-paths/(workflow)/query-builder/_components/query-execution-error.test.tsx @@ -13,9 +13,8 @@ describe("QueryExecutionError", () => { render(); // Then - expect( - screen.getByRole("heading", { name: /query execution failed/i }), - ).toBeInTheDocument(); + expect(screen.getByRole("alert")).toBeInTheDocument(); + expect(screen.getByText(/query execution failed/i)).toBeInTheDocument(); expect( screen.getByText(/the attack paths query could not be executed/i), ).toBeInTheDocument(); diff --git a/ui/app/(prowler)/attack-paths/(workflow)/query-builder/_components/query-parameters-form.test.tsx b/ui/app/(prowler)/attack-paths/(workflow)/query-builder/_components/query-parameters-form.test.tsx index dff2b087bc..ad704f3d8f 100644 --- a/ui/app/(prowler)/attack-paths/(workflow)/query-builder/_components/query-parameters-form.test.tsx +++ b/ui/app/(prowler)/attack-paths/(workflow)/query-builder/_components/query-parameters-form.test.tsx @@ -42,6 +42,43 @@ function TestForm() { ); } +function TestCustomQueryForm() { + const customQuery: AttackPathQuery = { + type: "attack-paths-scans", + id: "custom-query", + attributes: { + name: "Custom openCypher query", + short_description: "Write your own openCypher query", + description: "Run a custom query against the graph.", + provider: "aws", + attribution: null, + parameters: [ + { + name: "query", + label: "openCypher query", + data_type: "string", + input_type: "textarea", + placeholder: "MATCH (n) RETURN n LIMIT 25", + description: "", + required: true, + }, + ], + }, + }; + + const form = useForm({ + defaultValues: { + query: "", + }, + }); + + return ( + + + + ); +} + describe("QueryParametersForm", () => { it("uses the field description as the placeholder instead of rendering helper text below", () => { // Given @@ -73,40 +110,7 @@ describe("QueryParametersForm", () => { it("renders a textarea when the parameter input type is textarea", () => { // Given - const customQuery: AttackPathQuery = { - type: "attack-paths-scans", - id: "custom-query", - attributes: { - name: "Custom openCypher query", - short_description: "Write your own openCypher query", - description: "Run a custom query against the graph.", - provider: "aws", - attribution: null, - parameters: [ - { - name: "query", - label: "openCypher query", - data_type: "string", - input_type: "textarea", - placeholder: "MATCH (n) RETURN n LIMIT 25", - description: "", - required: true, - }, - ], - }, - }; - - const form = useForm({ - defaultValues: { - query: "", - }, - }); - - render( - - - , - ); + render(); // When const input = screen.getByRole("textbox", { name: /opencypher query/i });