[fixes #56831358] refactor tests for cleaner and more readable code