mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
towards making test driver work in new world
This commit is contained in:
@@ -220,7 +220,7 @@ var _testStatus = function(t) {
|
||||
|
||||
//// Template - navBars
|
||||
|
||||
Template.navBars({
|
||||
Template.navBars.helpers({
|
||||
running: function() {
|
||||
countDep.depend();
|
||||
return running;
|
||||
@@ -254,7 +254,7 @@ Template.navBars({
|
||||
|
||||
//// Template - progressBar
|
||||
|
||||
Template.progressBar({
|
||||
Template.progressBar.helpers({
|
||||
running: function () {
|
||||
countDep.depend();
|
||||
return running;
|
||||
@@ -304,7 +304,7 @@ var changeToPath = function (path) {
|
||||
Reload._reload();
|
||||
};
|
||||
|
||||
Template.groupNav({
|
||||
Template.groupNav.helpers({
|
||||
groupPaths: function () {
|
||||
var groupPath = Session.get("groupPath");
|
||||
var ret = [];
|
||||
@@ -318,7 +318,7 @@ Template.groupNav({
|
||||
}
|
||||
});
|
||||
|
||||
Template.groupNav({
|
||||
Template.groupNav.events({
|
||||
'click .group': function () {
|
||||
changeToPath(this.path);
|
||||
},
|
||||
@@ -331,7 +331,7 @@ Template.groupNav({
|
||||
|
||||
//// Template - failedTests
|
||||
|
||||
Template.failedTests({
|
||||
Template.failedTests.helpers({
|
||||
failedTests: function() {
|
||||
countDep.depend();
|
||||
return failedTests;
|
||||
@@ -340,7 +340,7 @@ Template.failedTests({
|
||||
|
||||
//// Template - testTable
|
||||
|
||||
Template.testTable({
|
||||
Template.testTable.helpers({
|
||||
testdata: function () {
|
||||
topLevelGroupsDep.depend();
|
||||
return resultTree;
|
||||
@@ -349,7 +349,7 @@ Template.testTable({
|
||||
|
||||
//// Template - test_group
|
||||
|
||||
Template.test_group({
|
||||
Template.test_group.helpers({
|
||||
'click .groupname': function (evt) {
|
||||
changeToPath(this.path);
|
||||
// prevent enclosing groups from also triggering on
|
||||
@@ -363,7 +363,7 @@ Template.test_group({
|
||||
|
||||
//// Template - test
|
||||
|
||||
Template.test({
|
||||
Template.test.helpers({
|
||||
test_status_display: function() {
|
||||
var status = _testStatus(this);
|
||||
if (status == "failed") {
|
||||
@@ -429,7 +429,7 @@ Template.test({
|
||||
}
|
||||
});
|
||||
|
||||
Template.test({
|
||||
Template.test.events({
|
||||
'click .testname': function () {
|
||||
this.expanded = ! this.expanded;
|
||||
this.dep.changed();
|
||||
@@ -439,7 +439,7 @@ Template.test({
|
||||
|
||||
//// Template - event
|
||||
|
||||
Template.event({
|
||||
Template.event.events({
|
||||
'click .debug': function () {
|
||||
// the way we manage groupPath, shortName, cookies, etc, is really
|
||||
// messy. needs to be aggressively refactored.
|
||||
@@ -449,7 +449,7 @@ Template.event({
|
||||
}
|
||||
});
|
||||
|
||||
Template.event({
|
||||
Template.event.helpers({
|
||||
get_details: function() {
|
||||
|
||||
var prepare = function(details) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
UI = {};
|
||||
|
||||
// A very basic operation like Underscore's `_.extend` that
|
||||
// copies `src`'s own, enumerable properties onto `tgt` and
|
||||
// returns `tgt`.
|
||||
@@ -33,7 +35,7 @@ var sanitizeTypeName = function (typeName) {
|
||||
'') || 'Component';
|
||||
};
|
||||
|
||||
UI = {
|
||||
_extend(UI, {
|
||||
nextGuid: 2, // Component is 1!
|
||||
|
||||
// Components and Component kinds are the same thing, just
|
||||
@@ -92,8 +94,7 @@ UI = {
|
||||
if (! c.dom)
|
||||
throw new Error("Component must be built into DOM to perform this operation");
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
|
||||
Component = UI.Component;
|
||||
|
||||
@@ -1122,3 +1123,13 @@ UI.body = UI.Component.extend({
|
||||
// XXX revisit how body works.
|
||||
INSTANCE: null
|
||||
});
|
||||
|
||||
_extend(UI.Component, {
|
||||
// XXX temporary definitions
|
||||
helpers: function (dict) {
|
||||
_extend(this, dict);
|
||||
},
|
||||
events: function (dict) {
|
||||
_extend(this, dict);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -11,8 +11,12 @@ Package.on_use(function (api) {
|
||||
api.use('ordered-dict');
|
||||
api.use('minimongo'); // for idStringify
|
||||
|
||||
api.add_files(['base.js',
|
||||
'attrs.js',
|
||||
api.add_files(['base.js']);
|
||||
|
||||
api.add_files(['dombackend.js',
|
||||
'domrange.js'], 'client');
|
||||
|
||||
api.add_files(['attrs.js',
|
||||
'render.js',
|
||||
'fields.js',
|
||||
'template.js',
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
var DomRange = UI.DomRange;
|
||||
|
||||
// Render an instance of a component kind directly into the DOM,
|
||||
// optionally with a parentComp (for e.g. name resolution).
|
||||
@@ -208,7 +209,7 @@ makeRenderBuffer = function (options) {
|
||||
|
||||
var range = component.dom;
|
||||
// assert: range is empty.
|
||||
var start = range.getFirstNode();
|
||||
var start = range.startNode();
|
||||
var nextNode = start.nextSibling;
|
||||
// jQuery does fancy html-to-DOM compat stuff here:
|
||||
$(start).after(html);
|
||||
|
||||
Reference in New Issue
Block a user