fix edit tab name bug and add unit test

@dmitchell can you review?

@ichuang , seems like your change made it so we can't rename tabs. Sorry, I should have caught that in the code review. Can you look at this PR and see if this change will work for your use case (I believe you were saying 'display_name' was None in your case).