Fixed bug with closing new item`s tab.
Added first tests