Add query tests