fix(downloads): GIF review round 2 — cap as sent, shown length, retry, Join reason
The panels judge a GIF's length in whole milliseconds between the ends as sent, the server's own rule, and a refused length reads rounded up. A shared picture says it failed only once its retry failed too. Join's reason shows on a key's focus; the editor's failure toasts name GIFs. The edit route's cap is test-held, and DESIGN.md records the GIF UI.
This commit is contained in:
@@ -66,6 +66,26 @@ def test_a_gif_edit_it_cannot_make_is_refused_with_its_reason(
|
||||
assert e.value.reason == reason
|
||||
|
||||
|
||||
@needs_ffmpeg
|
||||
def test_the_edit_route_says_a_gif_too_long_with_its_cap(
|
||||
db, make_user, as_user, tmp_path, monkeypatch
|
||||
):
|
||||
monkeypatch.setattr(settings, "files_root", str(tmp_path / "root"))
|
||||
u = make_user()
|
||||
c = as_user(u)
|
||||
source = _source(db, u, tmp_path)
|
||||
r = c.post(
|
||||
"/api/downloads/edit",
|
||||
json={
|
||||
"source_job_id": source.id,
|
||||
"edit_spec": {"trim": {"start_s": 0, "end_s": 30.5}, "gif": {"side": 480}},
|
||||
},
|
||||
)
|
||||
assert r.status_code == 400, r.text
|
||||
# The cap goes along: the refusal's sentence says it ("at most 30 seconds").
|
||||
assert r.json()["detail"] == {"code": "edit", "reason": "gif_too_long", "limit_s": 30}
|
||||
|
||||
|
||||
@needs_ffmpeg
|
||||
def test_a_gif_edit_of_exactly_thirty_seconds_is_allowed(db, make_user, tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(settings, "files_root", str(tmp_path / "root"))
|
||||
|
||||
Reference in New Issue
Block a user