Refactor query parser test

kanban #1362885