Refactor package and container registry tests helpers function
As a followup to the conversation in this mr: !20349 (merged) the purpose of this issue is to remove the parameter in the findElements function in the jest test suite.
As per described here: !20349 (comment 247598769)