-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_ui_integration.py
More file actions
50 lines (37 loc) · 1.42 KB
/
test_ui_integration.py
File metadata and controls
50 lines (37 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from ace import app
from ace_lib.models.schemas import Agent, AgentsConfig
from typer.testing import CliRunner
runner = CliRunner()
def test_ui_mockup_command(tmp_path, monkeypatch):
# Setup mock .ace directory
ace_dir = tmp_path / ".ace"
ace_dir.mkdir()
(ace_dir / "agents.yaml").write_text("version: '1'\nagents: []")
# Mock load_agents to return a test agent
test_agent = Agent(
id="ui-agent-01",
name="Vogue",
role="ui-agent",
email="vogue@ace.local",
memory_file=".cursor/rules/ui.mdc"
)
def mock_load_agents():
return AgentsConfig(version="1", agents=[test_agent])
monkeypatch.setattr("ace.service.load_agents", mock_load_agents)
monkeypatch.chdir(tmp_path)
# Run ace ui mockup
result = runner.invoke(app, ["ui", "mockup", "Create a login page", "--agent", "ui-agent-01"])
assert result.exit_code == 0
assert "Generating UI mockup" in result.stdout
assert "Create a login page" in result.stdout
assert "ui-agent-01" in result.stdout
def test_ui_sync_command(tmp_path, monkeypatch):
# Setup mock .ace directory
ace_dir = tmp_path / ".ace"
ace_dir.mkdir()
monkeypatch.chdir(tmp_path)
# Run ace ui sync
result = runner.invoke(app, ["ui", "sync", "https://stitch.google.com/canvas/123"])
assert result.exit_code == 0
assert "Syncing UI code from:" in result.stdout
assert "123" in result.stdout