v2.18.0 (#843)
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai> Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai> Co-authored-by: Cyprien <courtot.c@gmail.com> Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com> Co-authored-by: Jean Burellier <sheplu@users.noreply.github.com> Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com> Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai> Co-authored-by: Nelson PROIA <144663685+Nelson-PROIA@users.noreply.github.com> Co-authored-by: Paul VEZIA <166131032+le-codeur-rapide@users.noreply.github.com> Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai> Co-authored-by: Quentin <quentin.torroba@mistral.ai> Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com> Co-authored-by: josephine-delas <57808586+josephine-delas@users.noreply.github.com> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
725d3a56ce
commit
e607ccbb00
242 changed files with 7372 additions and 1974 deletions
|
|
@ -3,8 +3,10 @@ from __future__ import annotations
|
|||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from textual.widgets import TextArea
|
||||
|
||||
from tests.conftest import build_test_vibe_app, build_test_vibe_config
|
||||
from vibe.cli.clipboard import copy_selection_to_clipboard
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
@ -51,3 +53,20 @@ async def test_mouse_up_respects_autocopy_config_disabled() -> None:
|
|||
async with app.run_test() as pilot:
|
||||
await pilot.click()
|
||||
mock_copy.assert_not_called()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_copy_selection_copies_text_area_selection() -> None:
|
||||
app = build_test_vibe_app()
|
||||
|
||||
with patch("vibe.cli.clipboard.try_copy_text_to_clipboard") as mock_copy:
|
||||
mock_copy.return_value = True
|
||||
async with app.run_test():
|
||||
text_area = app.query_one(TextArea)
|
||||
text_area.load_text("hello world")
|
||||
text_area.select_all()
|
||||
|
||||
result = copy_selection_to_clipboard(app, show_toast=False)
|
||||
|
||||
assert result == "hello world"
|
||||
mock_copy.assert_called_once_with("hello world")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue