feat(FN-1112): remove browser-verification special-case UI
- Remove the hardcoded Browser Verification checkbox from TaskForm and rely on configured workflow steps - Remove the InlineCreateCard Browser toggle and stop injecting browser-verification into create payloads - Align TaskForm and InlineCreateCard tests with template-only workflow-step selection behavior - Delete obsolete NewTaskModal and TaskDetailModal assertions for browser-verification controls
This commit is contained in:
@@ -246,77 +246,6 @@ describe("NewTaskModal", () => {
|
||||
expect(createButton).not.toBeDisabled();
|
||||
});
|
||||
|
||||
// Browser verification tests
|
||||
describe("browser verification", () => {
|
||||
it("shows browser verification checkbox", () => {
|
||||
renderNewTaskModal();
|
||||
|
||||
expect(screen.getByTestId("browser-verification-checkbox")).toBeTruthy();
|
||||
expect(screen.getByText("Browser Verification")).toBeTruthy();
|
||||
});
|
||||
|
||||
it("adds browser-verification to selected workflow steps when checkbox is checked", async () => {
|
||||
const { props } = renderNewTaskModal();
|
||||
|
||||
const checkbox = screen.getByTestId("browser-verification-checkbox").querySelector('input[type="checkbox"]') as HTMLInputElement;
|
||||
fireEvent.click(checkbox);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(checkbox.checked).toBe(true);
|
||||
});
|
||||
|
||||
const descTextarea = screen.getByLabelText(/Description/i);
|
||||
fireEvent.change(descTextarea, { target: { value: "Test task" } });
|
||||
|
||||
fireEvent.click(screen.getByRole("button", { name: "Create Task" }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(props.onCreateTask).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
enabledWorkflowSteps: expect.arrayContaining(["browser-verification"]),
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it("removes browser-verification from selected workflow steps when checkbox is unchecked", async () => {
|
||||
renderNewTaskModal();
|
||||
|
||||
const checkbox = screen.getByTestId("browser-verification-checkbox").querySelector('input[type="checkbox"]') as HTMLInputElement;
|
||||
|
||||
// Check then uncheck
|
||||
fireEvent.click(checkbox);
|
||||
await waitFor(() => {
|
||||
expect(checkbox.checked).toBe(true);
|
||||
});
|
||||
|
||||
fireEvent.click(checkbox);
|
||||
await waitFor(() => {
|
||||
expect(checkbox.checked).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
it("includes browser-verification in enabledWorkflowSteps when submitting with checkbox checked", async () => {
|
||||
const { props } = renderNewTaskModal();
|
||||
|
||||
const checkbox = screen.getByTestId("browser-verification-checkbox").querySelector('input[type="checkbox"]') as HTMLInputElement;
|
||||
fireEvent.click(checkbox);
|
||||
|
||||
const descTextarea = screen.getByLabelText(/Description/i);
|
||||
fireEvent.change(descTextarea, { target: { value: "Browser test task" } });
|
||||
|
||||
fireEvent.click(screen.getByRole("button", { name: "Create Task" }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(props.onCreateTask).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
enabledWorkflowSteps: ["browser-verification"],
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Preset selection tests (FN-819)
|
||||
describe("model preset selection payload", () => {
|
||||
it("omits modelPresetId from payload when in default mode", async () => {
|
||||
@@ -493,24 +422,6 @@ describe("NewTaskModal", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("sends browser-verification and custom steps in selected order", async () => {
|
||||
const { props } = renderNewTaskModal();
|
||||
|
||||
// Select browser-verification first, then nothing else — order is just one
|
||||
const bvCheckbox = screen.getByTestId("browser-verification-checkbox").querySelector('input[type="checkbox"]') as HTMLInputElement;
|
||||
fireEvent.click(bvCheckbox);
|
||||
|
||||
fireEvent.change(screen.getByLabelText(/Description/i), { target: { value: "BV task" } });
|
||||
fireEvent.click(screen.getByRole("button", { name: "Create Task" }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(props.onCreateTask).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
enabledWorkflowSteps: ["browser-verification"],
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// DefaultOn workflow step handling (FN-883)
|
||||
|
||||
Reference in New Issue
Block a user