package commerce

import (
	"net/http/httptest"
	"testing"
)

func TestAdminListQueryCompatibility(t *testing.T) {
	req := httptest.NewRequest("GET", "/admin/users?keyword=alice&role=user&status=active&group_id=12&limit=25&offset=5", nil)
	query := (&AdminHandler{}).query(req)
	if query.Search != "alice" || query.Role != "user" || query.Status != "active" {
		t.Fatalf("query filters = %#v", query)
	}
	if query.GroupID == nil || *query.GroupID != 12 || query.Limit != 25 || query.Offset != 5 {
		t.Fatalf("query pagination/group = %#v", query)
	}
}
