Add tests for query