From 61f934d19ff4d3495c90a2fee86b1d68e8429152 Mon Sep 17 00:00:00 2001 From: Leonid Pershin Date: Mon, 27 Jul 2026 11:39:49 +0300 Subject: [PATCH] Update ListUsersTests to validate UserListFilter sorting and defaults Enhanced the ListUsersTests by adding a comprehensive check for the UserListFilter, ensuring that sorting defaults are correctly applied when not specified in the request. This change improves the accuracy of the tests related to user listing functionality. --- .../tests/TeleWave.Application.Tests/Admin/ListUsersTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/tests/TeleWave.Application.Tests/Admin/ListUsersTests.cs b/backend/tests/TeleWave.Application.Tests/Admin/ListUsersTests.cs index 6ce4cc8..f9fdfd7 100644 --- a/backend/tests/TeleWave.Application.Tests/Admin/ListUsersTests.cs +++ b/backend/tests/TeleWave.Application.Tests/Admin/ListUsersTests.cs @@ -50,10 +50,12 @@ public class ListUsersTests CancellationToken.None ); + // Сверяем фильтр целиком, а не по полям: он record, и значение сравнивается по значению — + // так проверяются и умолчания сортировки, которые запрос не задавал. await identity .Received(1) .ListUsersAsync( - Arg.Is(f => f.Sort == null && !f.Desc && f.Search == null), + new UserListFilter(1, 20, null, null, null), Arg.Any() ); }