Merge "Add tests for new logic introduced in ag/28573612" into main