add condtional query tests