feat: refine metadata catalog workflows
This commit is contained in:
@@ -15,6 +15,19 @@ const actions = [
|
||||
},
|
||||
] as const;
|
||||
|
||||
test("disables the picker when no rows are selected", () => {
|
||||
render(
|
||||
<FleetActionSelector
|
||||
actions={actions}
|
||||
selectedCount={0}
|
||||
onRun={vi.fn()}
|
||||
onClear={vi.fn()}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(screen.getByRole("combobox", { name: "Batch action" })).toBeDisabled();
|
||||
});
|
||||
|
||||
test("keeps unavailable commands discoverable and explains why Run is disabled", async () => {
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
@@ -50,6 +63,7 @@ test("runs an enabled command explicitly and resets the picker", async () => {
|
||||
await user.selectOptions(picker, "sync");
|
||||
expect(screen.getByText("All tables in this database")).toBeVisible();
|
||||
expect(screen.getByText("Action scope")).toBeVisible();
|
||||
expect(screen.getByRole("button", { name: "Run action" })).toHaveClass("bg-destructive");
|
||||
await user.click(screen.getByRole("button", { name: "Run action" }));
|
||||
|
||||
expect(onRun).toHaveBeenCalledWith("sync");
|
||||
|
||||
Reference in New Issue
Block a user