component-test icon indicating copy to clipboard operation
component-test copied to clipboard

use suite.title for page title

Open stephenmathieson opened this issue 12 years ago • 4 comments

this is really just my ocd, but when using component test browser, i don't want the page title to always be "domify tests"

stephenmathieson avatar Dec 11 '13 15:12 stephenmathieson

could do something like this:

!function() {
  var mocha = window.mochaPhantomJS || window.mocha;
  var suites = mocha.suite.suites;
  var title = [];
  for (var i = 0; i < suites.length; i++) title.push(suites[i].title);
  document.title = title.join(', ') + ' tests';
}()

in client/mocha.html. if you're up for it, i'll create a pr.

stephenmathieson avatar Dec 11 '13 15:12 stephenmathieson

+1, I like where this is going but could the <title> get a bit long?

What if it changed on suite end?

matthewmueller avatar Dec 11 '13 17:12 matthewmueller

wouldnt it make most sense to use the name prop of component.json?

ianstormtaylor avatar Dec 11 '13 19:12 ianstormtaylor

it would, but we don't have access to that data with the current impl. :/

stephenmathieson avatar Dec 11 '13 19:12 stephenmathieson