Add tests for queries