feat(FN-806): replace hardcoded border-radius with dashboard token in agent-create-form
- Replace hardcoded border-radius value in AgentsView agent create form with CSS variable token - Update dashboard README styling description for the Agents View create-form - Add unit test for agent create form border-radius token usage
This commit is contained in:
@@ -612,7 +612,7 @@ export function AgentsView({ addToast, projectId }: AgentsViewProps) {
|
||||
margin-bottom: 16px;
|
||||
padding: 16px;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 8px;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.agent-create-form .input {
|
||||
|
||||
@@ -349,6 +349,33 @@ describe("AgentsView", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it("renders create form with dashboard token-based styling", async () => {
|
||||
render(<AgentsView addToast={mockAddToast} />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText("New Agent")).toBeTruthy();
|
||||
});
|
||||
|
||||
fireEvent.click(screen.getByText("New Agent"));
|
||||
|
||||
// The create form container is rendered
|
||||
const createForm = document.querySelector(".agent-create-form");
|
||||
expect(createForm).toBeTruthy();
|
||||
|
||||
// The inline style block should use var(--radius-sm) instead of hardcoded 8px
|
||||
const styleElements = document.querySelectorAll("style");
|
||||
let foundCreateFormRule = false;
|
||||
styleElements.forEach(styleEl => {
|
||||
const css = styleEl.textContent ?? "";
|
||||
if (css.includes(".agent-create-form")) {
|
||||
foundCreateFormRule = true;
|
||||
// Must not contain hardcoded border-radius: 8px
|
||||
expect(css).not.toMatch(/\.agent-create-form\s*\{[^}]*border-radius:\s*8px/);
|
||||
}
|
||||
});
|
||||
expect(foundCreateFormRule).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("change agent state", () => {
|
||||
|
||||
Reference in New Issue
Block a user