Added a rerun-scheduled indicator

This commit is contained in:
Naomi Seyfer
2013-02-21 17:21:18 -08:00
parent bed981f4b0
commit 7ad9944598
2 changed files with 23 additions and 2 deletions

View File

@@ -68,6 +68,17 @@
<li><a class="group" href="#">{{name}}</a></li>
{{/each}}
</ul>
<form class="navbar-form pull-right">
<a class="btn rerun">
{{#if rerunScheduled}}
Rerun scheduled... <i class="icon-time"></i>
{{else}}
<i class="icon-repeat"></i>
Rerun
{{/if}}
</a>
</form>
&nbsp;
</div>
</div>
</template>

View File

@@ -8,8 +8,9 @@ var totalCount = 0;
var passedCount = 0;
var failedCount = 0;
if (!Session.get("groupPath"))
Session.set("groupPath", ["tinytest"]);
Session.setDefault("groupPath", ["tinytest"]);
Session.set("rerunScheduled", false);
Meteor.startup(function () {
Meteor.flush();
@@ -55,8 +56,13 @@ Template.groupNav.groupPaths = function () {
return ret;
};
Template.groupNav.rerunScheduled = function () {
return Session.get("rerunScheduled");
};
var changeToPath = function (path) {
Session.set("groupPath", path);
Session.set("rerunScheduled", true);
// pretend there's just been a hot code push
// so we run the tests completely fresh.
Meteor._reload.reload();
@@ -65,6 +71,10 @@ var changeToPath = function (path) {
Template.groupNav.events({
"click .group": function () {
changeToPath(this.path);
},
"click .rerun": function () {
Session.set("rerunScheduled", true);
Meteor._reload.reload();
}
});