feat(FN-1358): replace text input with always-dropdown in MessageComposer

- Replace text input with always-open dropdown in MessageComposer component
- Update MessageComposer tests to cover dropdown behavior
- Remove .message-composer-input from shared CSS rule
This commit is contained in:
gsxdsm
2026-04-09 16:35:41 -07:00
parent 704f262282
commit 69a4507113
3 changed files with 36 additions and 31 deletions

View File

@@ -69,10 +69,22 @@ describe("MessageComposer", () => {
expect(select.tagName).toBe("SELECT");
});
it("shows text input when no agents provided", () => {
it("disables recipient select when agents list is empty", () => {
render(<MessageComposer {...defaultProps} />);
const input = screen.getByTestId("message-composer-recipient");
expect(input.tagName).toBe("INPUT");
const select = screen.getByTestId("message-composer-recipient");
expect(select).toBeDefined();
expect(select.tagName).toBe("SELECT");
expect(select.hasAttribute("disabled")).toBe(true);
expect(select.textContent).toContain("No agents available");
});
it("shows loading state in recipient select", () => {
render(<MessageComposer {...defaultProps} isLoadingAgents={true} />);
const select = screen.getByTestId("message-composer-recipient");
expect(select).toBeDefined();
expect(select.tagName).toBe("SELECT");
expect(select.hasAttribute("disabled")).toBe(true);
expect(select.textContent).toContain("Loading agents…");
});
it("disables send button when content is empty", () => {