Refactor test logic for switching editor tabs