From 9117c95ffddf7c319abc099b31ea49c199f6355a Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Fri, 28 Apr 2023 15:56:04 +0200 Subject: [PATCH] Add test for empty version --- clientapi/clientapi_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/clientapi/clientapi_test.go b/clientapi/clientapi_test.go index 73423b927..2c34c1098 100644 --- a/clientapi/clientapi_test.go +++ b/clientapi/clientapi_test.go @@ -2090,6 +2090,15 @@ func TestKeyBackup(t *testing.T) { handleResponseCode(t, rec, http.StatusOK) }, }, + { + name: "deleting an empty version doesn't work", // make sure we can't delete an empty backup version. Handled at the router level + request: func(t *testing.T) *http.Request { + return httptest.NewRequest(http.MethodDelete, "/_matrix/client/v3/room_keys/version/", nil) + }, + validate: func(t *testing.T, rec *httptest.ResponseRecorder) { + handleResponseCode(t, rec, http.StatusNotFound) + }, + }, } test.WithAllDatabases(t, func(t *testing.T, dbType test.DBType) {