test.jade, factor out tab selection to utility function