feat: add tactility controls and notes CRUD

This commit is contained in:
Adolfo Reyna
2026-08-17 13:19:36 -04:00
parent c445093186
commit 1996a123d9
7 changed files with 426 additions and 18 deletions
+20 -1
View File
@@ -12,7 +12,7 @@ from types import SimpleNamespace
from typer.testing import CliRunner
from reyna_cli.cli import app
from reyna_cli.notes_direct import create_note, list_notes, read_note
from reyna_cli.notes_direct import create_note, delete_note, list_notes, read_note, update_note
runner = CliRunner()
@@ -63,6 +63,25 @@ def test_read_and_create_notes_use_json_arguments_without_script_interpolation()
assert created["id"] == "new-1"
def test_update_and_delete_notes_use_fixed_jxa_and_json_arguments():
updated = update_note(
"x-coredata://note-1",
title="Updated",
body="New body",
runner=_success_runner(
{"id": "x-coredata://note-1", "title": "Updated", "body": "New body"},
{"id": "x-coredata://note-1", "title": "Updated"},
),
)
assert updated["title"] == "Updated"
deleted = delete_note(
"x-coredata://note-1",
runner=_success_runner({"id": "x-coredata://note-1"}, {"id": "x-coredata://note-1", "deleted": True}),
)
assert deleted["deleted"] is True
def test_notes_cli_is_available_at_top_level_and_macmini_alias(monkeypatch):
monkeypatch.setattr("reyna_cli.cli.list_notes", lambda **_: [{"id": "n1", "title": "Test"}])